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
stri
>>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,
>> dateCompo
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 upda
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 #!/usr/bin
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
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 #
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 cha
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 functi
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 ValueErr
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
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
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 an
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
curegistry.setvalu
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 = (
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,
Since self.connect() is always called, you should document that the
initial hkey parameter has to be one of the following predefined key
handles:
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_PERFORMANCE_DATA
WinAPI RegConnectRegistryW() only matters when the target computer is
a different machi
On 13/05/2022 4:14 pm, Eryk Sun wrote:
Since self.connect() is always called, you should document that the
initial hkey parameter has to be one of the following predefined key
handles:
HKEY_LOCAL_MACHINE
HKEY_USERS
I'm targeting HKEY_CURRENT_USER so I assume HK_USERS includes that.
On 5/13/22, Mike Dewhirst wrote:
> On 13/05/2022 4:14 pm, Eryk Sun wrote:
>> Since self.connect() is always called, you should document that the
>> initial hkey parameter has to be one of the following predefined key
>> handles:
>>
>> HKEY_LOCAL_MACHINE
>> HKEY_USERS
>
> I'm targeting HK
18 matches
Mail list logo