[Solved] Re: Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst
Eryk Many thanks. It is working perfectly now. See below for the reworked code. Cheers Mike On 13/05/2022 1:42 pm, Eryk Sun wrote: On 5/12/22, Mike Dewhirst wrote: access=wr.KEY_ALL_ACCESS + wr.KEY_WRITE, import winreg as wr class Registry: def __init__(self, computer=None,

Re: Windows registry PermissionError

2022-05-12 Thread Eryk Sun
On 5/12/22, Mike Dewhirst wrote: > > access=wr.KEY_ALL_ACCESS + wr.KEY_WRITE, The access parameter is a bit mask of access rights that combine via bitwise OR (|), not via arithmetic addition. KEY_ALL_ACCESS (0x000F_003F) is a superset of KEY_WRITE (0x0002_0006): KEY_WRITE = (

Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst
I'm trying to copy a value from HKLM to HKCU for application rollout via bulk installation by an administrator but individual Windows user setup. Getting this ... Traceback (most recent call last):   File "D:\Users\mike\envs\chemdata\registry\wreg\wreg.py", line 84, in    

Accuracy of multiprocessing.Queue.qsize before any Queue.get invocations?

2022-05-12 Thread Tim Chase
The documentation says[1] > Return the approximate size of the queue. Because of > multithreading/multiprocessing semantics, this number is not > reliable. Are there any circumstances under which it *is* reliable? Most germane, if I've added a bunch of items to the Queue, but not yet launched

Re: tail

2022-05-12 Thread Cameron Simpson
On 12May2022 19:48, Marco Sulla wrote: >On Thu, 12 May 2022 at 00:50, Stefan Ram wrote: >> There's no spec/doc, so one can't even test it. > >Excuse me, you're very right. > >""" >A function that "tails" the file. If you don't know what that means, >google "man tail" > >filepath: the file path

Re: tail

2022-05-12 Thread Dennis Lee Bieber
On Thu, 12 May 2022 22:45:42 +0200, Marco Sulla declaimed the following: > >Maybe. Maybe not. What if the file ends with no newline? https://github.com/coreutils/coreutils/blob/master/src/tail.c Lines 567-569 (also lines 550-557 for "bytes_read" determination) -- Wulfraed

Re: tail

2022-05-12 Thread Marco Sulla
Thank you very much. This helped me to improve the function: import os _lf = b"\n" _err_n = "Parameter n must be a positive integer number" _err_chunk_size = "Parameter chunk_size must be a positive integer number" def tail(filepath, n=10, chunk_size=100): if (n <= 0): raise

Re: Changing calling sequence

2022-05-12 Thread Michael F. Stemper
On 11/05/2022 14.58, anthony.flury wrote: Why not do :   def TempsOneDayDT(date:datetime.date): return TempsOneDay(date.year, date.month, date.day) No repeat of code - just a different interface to the same functionality. Yeah, a one-line wrapper around the original

Re: "py" command for Linux and Mac?

2022-05-12 Thread De ongekruisigde
On 2022-05-12, Mats Wichmann wrote: > On 5/12/22 10:25, Dan Stromberg wrote: >> Hi folks. >> >> I heard there's a Windows-like "py" command for Linux (and Mac?). >> >> I'm finally getting to porting a particular project's Python 2.7 code to >> 3.x, and one of the first steps will probably be

Re: "py" command for Linux and Mac?

2022-05-12 Thread Mats Wichmann
On 5/12/22 10:25, Dan Stromberg wrote: > Hi folks. > > I heard there's a Windows-like "py" command for Linux (and Mac?). > > I'm finally getting to porting a particular project's Python 2.7 code to > 3.x, and one of the first steps will probably be changing a lot of "python2 > script.py" to use

Re: tail

2022-05-12 Thread Marco Sulla
On Thu, 12 May 2022 at 00:50, Stefan Ram wrote: > > Marco Sulla writes: > >def tail(filepath, n=10, chunk_size=100): > >if (n <= 0): > >raise ValueError(_err_n) > ... > > There's no spec/doc, so one can't even test it. Excuse me, you're very right. """ A function that "tails" the

Re: "py" command for Linux and Mac?

2022-05-12 Thread MRAB
On 2022-05-12 17:25, Dan Stromberg wrote: Hi folks. I heard there's a Windows-like "py" command for Linux (and Mac?). I'm finally getting to porting a particular project's Python 2.7 code to 3.x, and one of the first steps will probably be changing a lot of "python2 script.py" to use

"py" command for Linux and Mac?

2022-05-12 Thread Dan Stromberg
Hi folks. I heard there's a Windows-like "py" command for Linux (and Mac?). I'm finally getting to porting a particular project's Python 2.7 code to 3.x, and one of the first steps will probably be changing a lot of "python2 script.py" to use #!/usr/bin/env python2 and chmod +x. Then we can

RE: Changing calling sequence

2022-05-12 Thread David Raymond
>>def TempsOneDay(*dateComponents): >>if len(dateComponents) == 3: >>year, month, date = dateComponents >>elif len(dateComponents) == 1 and isinstance(dateComponents[0], >> datetime.date): >>year, month, date = (dateComponents[0].year, dateComponents[0].month, >>

[Python-announce] ANN: poliastro 0.16.3 released 

2022-05-12 Thread Juan Luis Cano Rodríguez
Hi all, It fills us with astronomical joy to announce the release of poliastro 0.16.3!  poliastro is an open source (MIT) pure Python library for interactive Astrodynamics and Orbital Mechanics, with a focus on ease of use, speed, and quick visualization. It provides a simple and intuitive API,

Re: [docs] Reporting a Bug

2022-05-12 Thread anthony.flury via Python-list
This is exactly as expected. Strip removes any of the characters in the passed string from both the front and the end of the string being stripped. The letter 'T' from the start of 'The meaning of life' does not appear in the word 'meaning' so nothing is removed from the start of the

Re: [Python-ideas] Re: New Tool Proposal

2022-05-12 Thread anthony.flury via Python-list
On 10/05/2022 15:04, Dan Stromberg wrote: On Tue, May 10, 2022 at 3:15 AM Chris Angelico wrote: > It is often the case that developer write Code in Python and then convert to a C extension module for performance regions. > > A C extension module has a lot of boiler plate code