[Python-ideas] Make py.exe default to Python 3

Alexander Walters tritium-list at sdamon.com
Tue Mar 8 23:32:34 EST 2016



On 3/8/2016 23:27, Jonathan Goble wrote:
> On Tue, Mar 8, 2016 at 11:06 PM, Alexander Walters
> <tritium-list at sdamon.com> wrote:
>> On 3/8/2016 23:05, Chris Angelico wrote:
>>>
>>> Have a read of PEP 397 if you want to know why the launcher exists.
>>>
>>> https://www.python.org/dev/peps/pep-0397/
>>>
>>> ChrisA
>> But who does that actually help?  I contest this attempts to solve a problem
>> (in the wrong way) that does not actually exist.
> Linux users are used to being able to type "./script.py" on the
> command line and have the shebang tell the OS which version of Python
> to use. Windows doesn't support that because it instead works off of
> associating the file extension globally with an individual program, so
> ".py" can only be associated with a single executable, which is
> unworkable if you have both python2 and python3 scripts. py.exe solves
> that problem.
>
> So unless you have an alternative solution to enable Unix-like script
> launching with multiple Python versions from the command line,
> proposing to eliminate py.exe is a non-starter, at least with me.
Windows is not *nix.  Supporting *nix idioms should not be a priority.  
If you want a python application that launches by double clicking it, 
which is the intent of py.exe by the pep, create a shortcut with the 
fully qualified path to python and the path to the module, or use 
py2exe.  If you want to launch something on the command line, put the 
python you want on %PATH%.  Or install a separately obtainable py.exe 
installer.

> On Tue, Mar 8, 2016 at 11:22 PM, Alexander Walters
> <tritium-list at sdamon.com> wrote:
>> It modifies the windows registry to set a file association, which is a pain
>> when you want double clicking a python file to open a text editor.  So you
>> have to change file associations, which was made really painful in recent
>> versions of windows.
> So add an option to the installer to not set that file association.
> It's been a while since I installed a Python on my Windows machine,
> but IIRC that option may already be there (I could be mistaken,
> though).
It's there, and VERY easy to miss.  Once installed, it is a pain to get 
rid of, since the uninstaller does NOT take it out.


More information about the Python-ideas mailing list