Re: What's tkinter doing in \Lib\site-packages\future\moves ?

2022-11-07 Thread Chris Angelico
On Tue, 8 Nov 2022 at 15:12, DFS wrote: > > 3.9.13 > My guess? Because you can "import tkinter" in Py3 but "import Tkinter" in Py2. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

What's tkinter doing in \Lib\site-packages\future\moves ?

2022-11-07 Thread DFS
3.9.13 -- https://mail.python.org/mailman/listinfo/python-list

Re: What is the reason from different output generate using logical 'and' and 'or' operator in Python 3.10.8

2022-11-07 Thread David
On Tue, 8 Nov 2022 at 03:08, ICT Ezy wrote: > Please explain how to generate different output in following logical > operations > >>> 0 and True > 0 > >>> 0 or True > True > >>> 1 and True > True > >>> 1 or True > 1 Hi, The exact explanation of how 'and' and 'or' behave can be read here: ht

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Thomas Passin
More discussion: https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my On 11/7/2022 5:35 PM, Cameron Simpson wrote: On 07Nov2022 09:28, Chris Green wrote: Chris Green wrote: > 3: with your pseudo "python3" script in place, make

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Cameron Simpson
On 07Nov2022 09:28, Chris Green wrote: Chris Green wrote: > 3: with your pseudo "python3" script in place, make all the scripts use > the "#!/usr/bin/env python3" shebang suggested above. > Yes, that sounds a good plan to me, thanks Cameron. Doesn't '#!/usr/bin/env python3' suffer from the s

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Angelico
On Tue, 8 Nov 2022 at 08:44, Chris Green wrote: > > Barry Scott wrote: > > > > > > > On 7 Nov 2022, at 09:28, Chris Green wrote: > > > > > > Chris Green wrote: > > >>> 3: with your pseudo "python3" script in place, make all the scripts use > > >>> the "#!/usr/bin/env python3" shebang suggested

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Barry Scott wrote: > > > > On 7 Nov 2022, at 09:28, Chris Green wrote: > > > > Chris Green wrote: > >>> 3: with your pseudo "python3" script in place, make all the scripts use > >>> the "#!/usr/bin/env python3" shebang suggested above. > >>> > >> Yes, that sounds a good plan to me, thanks C

Re: How to turn this Matlab code into python

2022-11-07 Thread Christian Gollwitzer
Am 07.11.22 um 18:12 schrieb Dioumacor FAYE: hi everyone I wanted to transform this matlab code into python. If anyone can help me please let me know. load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat prcp = reshape(precip,[140*100,13879]); dates = datenum(1981,1,1):datenum(20

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Christian Gollwitzer
Am 07.11.22 um 10:28 schrieb Chris Green: Chris Green wrote: 3: with your pseudo "python3" script in place, make all the scripts use the "#!/usr/bin/env python3" shebang suggested above. Yes, that sounds a good plan to me, thanks Cameron. Doesn't '#!/usr/bin/env python3' suffer from the sam

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Barry Scott
> On 7 Nov 2022, at 09:28, Chris Green wrote: > > Chris Green wrote: >>> 3: with your pseudo "python3" script in place, make all the scripts use >>> the "#!/usr/bin/env python3" shebang suggested above. >>> >> Yes, that sounds a good plan to me, thanks Cameron. >> > Doesn't '#!/usr/bin/env

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Schachner, Joseph (US) wrote: > Maybe you can't do this, but I would suggest only running on the Python > 3 systems. Refuse to jump through hoops for the Python 2 system. It is > years out of date. Exactly! That's why I (OP) have only one system where this is a problem. The system is my hostin

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Angelico
On Tue, 8 Nov 2022 at 06:12, Thomas Passin wrote: > > The problem is that some Linux systems - I think - still use Python2 to > perform various system-related tasks. When they call "python", they > need it to be Python2. If someone has a system like that, they can't > have the "python" command r

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Thomas Passin
The problem is that some Linux systems - I think - still use Python2 to perform various system-related tasks. When they call "python", they need it to be Python2. If someone has a system like that, they can't have the "python" command run Python3. On 11/7/2022 1:07 PM, Schachner, Joseph (US)

RE: How to manage python shebang on mixed systems?

2022-11-07 Thread Schachner, Joseph (US)
Maybe you can't do this, but I would suggest only running on the Python 3 systems. Refuse to jump through hoops for the Python 2 system. It is years out of date. It is not hard to upgrade from Python 2 to Python 3. There is a 2to3 utility, and after that there should be very few things you wa

How to turn this Matlab code into python

2022-11-07 Thread Dioumacor FAYE
hi everyone I wanted to transform this matlab code into python. If anyone can help me please let me know. load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat prcp = reshape(precip,[140*100,13879]); dates = datenum(1981,1,1):datenum(2018,12,31); date = datevec(dates); ind_mjja=find

What is the reason from different output generate using logical 'and' and 'or' operator in Python 3.10.8

2022-11-07 Thread ICT Ezy
Please explain how to generate different output in following logical operations >>> 0 and True 0 >>> 0 or True True >>> 1 and True True >>> 1 or True 1 -- https://mail.python.org/mailman/listinfo/python-list

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Chris Green wrote: > > 3: with your pseudo "python3" script in place, make all the scripts use > > the "#!/usr/bin/env python3" shebang suggested above. > > > Yes, that sounds a good plan to me, thanks Cameron. > Doesn't '#!/usr/bin/env python3' suffer from the same problem as '#!/usr/bin/pytho

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Chris Green
Cameron Simpson wrote: > On 06Nov2022 20:51, jak wrote: > >Il 06/11/2022 11:03, Chris Green ha scritto: > >>I have a number of python scripts that I run on a mix of systems. I > >>have updated them all to run on python 3 but many will also run quite > >>happily with python 2. They all have a #!

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread 2QdxY4RzWzUUiLuE
On 2022-11-07 at 11:56:19 +, "Weatherby,Gerard" wrote: > Write the wrapper script. > > #!/bin/bash > if [ $(hostname) == "oldystem" ]; then > exec /usr/bin/python $* > else > exec /usr/bin/python2 $* > fi Use "$@" (with the quotes) instead of a bare $*. The former preserves quoted

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Weatherby,Gerard
Write the wrapper script. #!/bin/bash if [ $(hostname) == "oldystem" ]; then exec /usr/bin/python $* else exec /usr/bin/python2 $* fi From: Python-list on behalf of Chris Green Date: Sunday, November 6, 2022 at 3:22 PM To: python-list@python.org Subject: Re: How to manage python sheba

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Barry
 > On 7 Nov 2022, at 03:15, Mike Dewhirst wrote: > > On 7/11/2022 6:51 am, jak wrote: >> Il 06/11/2022 11:03, Chris Green ha scritto: >>> I have a number of python scripts that I run on a mix of systems. I >>> have updated them all to run on python 3 but many will also run quite >>> happily w