Steven D'Aprano wrote:
> On Mon, Mar 23, 2020 at 05:59:41PM -0000, Frédéric De Jaeger wrote:
> > The issue is:  There is no reliable way to launch a
> > python script.
> > The command:
> >  python myscript.py
> > 
> > launches python3 on windows and python2 on 99% of the unix market.
> > Its probably less than 99% by now, but still quite high.
> Do I understand you that "python" (without a full pathname) is supported 
> on Windows? If I understand Brett's later comment, I expect that by 
> default your Windows users will need to type the full pathname, since 
> Python isn't added to the PATH.

I suppose we tell all our windows users (which I'm not) to be sure to have 
python in their PATH.  So they should have used the installer facility for that.


> Are you familar with the py.exe Windows launcher? Does it help?
> https://www.python.org/dev/peps/pep-0397/
> Perhaps you can just have your Windows users call "py myscript.py" and 
> your non-Windows users call "myscript.py" (after setting the 
> appropriate hashbang referring to python3).

One of our constraint is that we use Cygwin's bash and now, every user relies 
on the shebang.
The problem reduce to this.  Assuming you are in a bash window (whether on 
cygwin or ubuntu 18, or mac os) and you do this:

      > ./myScript.py

How do you write the shebang so it runs reliably python3 with the minimal 
amount of energy spent configuring the system.

So, `py` launcher does not seem to solve our problem.


> In other words, your idea is for Python on Windows to support "python3" 
> as well as "python". Is that correct?

Yes, that would be ideal.  All our scripts would work out of the box, given our 
workflow.

From that doc:  
https://docs.python.org/3/using/windows.html#the-microsoft-store-package

It seems `python3.exe` is available when we installed python from the windows 
store.  So maybe a solution is that we tell our employees to install that
version instead.

That is just a bit odd the _traditional installer_ does not do the same thing.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/5V4AJGK3HFKM7XGCLZUA75K2OTAJN5QO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to