Apologies for top posting - my phone seems unable to do otherwise.

Here's my view - which may not be popular.

1. Py.exe is an awful idea. 

2. Installing python in %PROGRAMFILES% is not a good idea

3. Installing Python from a Microsoft shop or server is a bad idea

4. Shebang lines are pretty much redundant now that most python interpreters 
are run from venvs

5. Shebang lines have never had a place in Windows

TL;DR

1. Py.exe is not a standard python thing and learning to rely on it is 
following Microsoft's marketing strategy. That strategy has served them 
brilliantly since the 1980s. They make their environment just different enough 
to force users to invest brainspace to make it work and thereby lock-in their 
users with their own muscle-memory. Very subtle. Not.

2. Installing Python in Microsoft's preferred location wasn't always 
"standard". Python downloaded from python.org always defaulted to C:\PythonXXX. 
I'm not saying that was a perfect location but at least it was (in my case 
still is) nicely visible for researching multiple different pythons. Putting 
deep in Program files does nothing other than hide it. 

3. You cannot trust Microsoft. You can trust Python Software Foundation. Python 
from PSF works the same in all environments - or if not it is a bug. Python 
from Microsoft is tweaked to satisfy their aforementioned strategy of locking 
in users to Windows.

4. Shebang lines are a fallback if you don't wish to type the interpreter 
location before typing your script name. You must know your interpreter 
location to get the shebang line right. Shebangs were never intended as primary 
devices. They are linux/unix things.

5. Shebangs on Windows are a new opportunity for Microsoft to plough its own 
furrow. They are difficult to handle simply because of 4 above.

To finish this rant, I believe it is far better to aim for standardisation 
rather than subtle and annoying differences deliberately designed to supplant 
standards in favour of market dominance.

Merry Christmas all

Cheers

Mike




On 24 December 2023 3:35:42 am AEDT, Michael Torrie via Python-list 
<python-list@python.org> wrote:
>On 12/22/23 20:56, Thomas Passin via Python-list wrote:
>> It's just better not to make assumptions about which version of Python 
>> will be running. Just specify it yourself when you can, and then you can 
>> be sure.
>
>Precisely, which is why the shebang is so useful, even on Windows with
>py launcher.  For example, set the shebang to:
>
>#!/usr/bin/python3.6
>
>And py launcher will always try to run it with Python 3.6.
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to