Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Chris Angelico
On Sat, Nov 27, 2021 at 4:47 PM Ulli Horlacher wrote: > > Richard Damon wrote: > > > On a somewhat locked down computer, the user does not have admin rights, > > so needs to get 'IT' to run any installers that need admin permissions > > to run. > > > > And EXE that just needs to be copied to the

Friday Finking: Docstrings and DataClasses

2021-11-26 Thread dn via Python-list
How have you updated your (team's) standards and conventions for docstrings, when using dataclasses? NB the question is specifically class-related. Whereas many of the examples 'here' are of functions; a docstring is a docstring, is a docstring. The original word on the subject is/was "PEP 257

Re: Negative subscripts

2021-11-26 Thread Frank Millman
On 2021-11-26 11:24 PM, dn via Python-list wrote: On 26/11/2021 22.17, Frank Millman wrote: In my program I have a for-loop like this - for item in x[:-y]: ...    [do stuff] 'y' may or may not be 0. If it is 0 I want to process the entire list 'x', but of course -0 equals 0, so it returns an

Re: Negative subscripts

2021-11-26 Thread Greg Ewing
On 2021-11-26 11:17 AM, Frank Millman wrote: Are there any other techniques anyone can suggest, or is the only alternative to use if...then...else to cater for y = 0? x[:-y or None] Seems to work: >>> l ['a', 'b', 'c', 'd', 'e'] >>> def f(x): return l[:-x or None] ... >>> f(3) ['a', 'b'] >>>

Failure to Display Top menu

2021-11-26 Thread Peter Mwale
Hello, my python 3.10 shell is not displaying the top menu. What should I do? -- Peter Mwale Principal Economist Ministry of Gender, Social Welfare and Community Development Private Bag 320 Lilongwe 3 Cell: +265 998 605 723 Phone: +265 1 788 888 Fax: +265 1 788 093 E-mail: petermwal...@gmail.com

Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Peter Heitzer
Ulli Horlacher wrote: >Edmondo Giovannozzi wrote: >> You can try to download winpython: >> https://github.com/winpython/winpython/releases >> It is an executable, but you don't need to execute it as it is a 7zip >> compressed archive. >> You may run it or use directly 7zip to decompress it, th

Re: Negative subscripts

2021-11-26 Thread Edmondo Giovannozzi
Il giorno venerdì 26 novembre 2021 alle 10:23:46 UTC+1 Frank Millman ha scritto: > Hi all > > In my program I have a for-loop like this - > > >>> for item in x[:-y]: > ...[do stuff] > > 'y' may or may not be 0. If it is 0 I want to process the entire list > 'x', but of course -0 equals

Re: Negative subscripts

2021-11-26 Thread Pieter van Oostrum
Frank Millman writes: > Hi all > > In my program I have a for-loop like this - > for item in x[:-y]: > ...    [do stuff] > > 'y' may or may not be 0. If it is 0 I want to process the entire list > 'x', but of course -0 equals 0, so it returns an empty list. > > In theory I can say > for

Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Edmondo Giovannozzi
Il giorno venerdì 26 novembre 2021 alle 08:13:50 UTC+1 Ulli Horlacher ha scritto: > Avi Gross wrote: > > > I am not sure what your real problem is, Ulli, but many antivirus programs > > can be TEMPORARILY shut off. > Meanwhile I found this configuration option. > But this does not help me muc

Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Ulli Horlacher
Edmondo Giovannozzi wrote: > You can try to download winpython: > https://github.com/winpython/winpython/releases > It is an executable, but you don't need to execute it as it is a 7zip > compressed archive. > You may run it or use directly 7zip to decompress it, the result will be the > same.

Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Ulli Horlacher
Avi Gross wrote: > I am not sure what your real problem is, Ulli, but many antivirus programs > can be TEMPORARILY shut off. Meanwhile I found this configuration option. But this does not help me much, because my programs must run on other Windows PCs of other users and they cannot disable the d

Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Ulli Horlacher
Richard Damon wrote: > On a somewhat locked down computer, the user does not have admin rights, > so needs to get 'IT' to run any installers that need admin permissions > to run. > > And EXE that just needs to be copied to the computer and rhen just RUN, > doesn't need IT to 'install' it (the

Re: Negative subscripts

2021-11-26 Thread dn via Python-list
On 26/11/2021 22.17, Frank Millman wrote: > In my program I have a for-loop like this - > for item in x[:-y]: > ...    [do stuff] > > 'y' may or may not be 0. If it is 0 I want to process the entire list > 'x', but of course -0 equals 0, so it returns an empty list. ... > But in my actual p

Re: Negative subscripts

2021-11-26 Thread Frank Millman
On 2021-11-26 11:17 AM, Frank Millman wrote: Hi all In my program I have a for-loop like this - >>> for item in x[:-y]: ...    [do stuff] 'y' may or may not be 0. If it is 0 I want to process the entire list 'x', but of course -0 equals 0, so it returns an empty list. In theory I can say

Re: Negative subscripts

2021-11-26 Thread Chris Angelico
On Fri, Nov 26, 2021 at 10:11 PM Rob Cliffe via Python-list wrote: > or, perhaps simplest, you could do > > for item in x[:-y or None]: # a value of None for a slice argument means > "don't slice here" > [do stuff] > This is the one I'd recommend. If you're negating a slice like this, just a

Re: Negative subscripts

2021-11-26 Thread Rob Cliffe via Python-list
You could evaluate y separately: yval = for item in x[:-yval] if yval else x:     [do stuff] or you could do it using the walrus operator: for item in x[:-yval] if (yval := ) else x:     [do stuff] or, perhaps simplest, you could do for item in x[:-y or None]: # a value of None for a slice a

Re: Negative subscripts

2021-11-26 Thread Antoon Pardon
Op 26/11/2021 om 10:17 schreef Frank Millman: Hi all In my program I have a for-loop like this - >>> for item in x[:-y]: ...    [do stuff] 'y' may or may not be 0. If it is 0 I want to process the entire list 'x', but of course -0 equals 0, so it returns an empty list. In theory I can say

Negative subscripts

2021-11-26 Thread Frank Millman
Hi all In my program I have a for-loop like this - >>> for item in x[:-y]: ...    [do stuff] 'y' may or may not be 0. If it is 0 I want to process the entire list 'x', but of course -0 equals 0, so it returns an empty list. In theory I can say >>> for item in x[:-y] if y else x: ...    [do