Shebang lines for Python on Windows
Shebang lines for Python on Windows
Posted Sep 26, 2022 13:20 UTC (Mon) by rschroev (subscriber, #4164)In reply to: Arch Linux drops Python 2 by agateau
Parent article: Arch Linux drops Python 2
#!/usr/bin/env python launches the default Python
#!/usr/bin/env python2 launches the most recent Python 2
#!/usr/bin/env python3.9 launches Python 3.9
See https://docs.python.org/3/using/windows.html#python-launc... and more specifically https://docs.python.org/3/using/windows.html#shebang-lines
In a nutshell, this makes it possible to have shebang lines that work on both Windows and Unix-like operating systems.
Posted Sep 26, 2022 14:05 UTC (Mon)
by agateau (subscriber, #57569)
[Link]
I still believe being able to reliably depend on the availability of a python3 binary on all supported platforms would have helped a lot.
Shebang lines for Python on Windows