[Python-ideas] Windows temporary file association for Python files

anatoly techtonik techtonik at gmail.com
Mon Oct 22 14:42:26 CEST 2012


On Mon, Oct 22, 2012 at 2:44 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 22 October 2012 11:51, anatoly techtonik <techtonik at gmail.com> wrote:
>> I wonder if it will make the life easier if Python was installed with
>> .py association to "%PYTHON_HOME%\python.exe" "%1" %*
>> It will remove the need to run .py scripts in virtualenv with explicit
>> 'python' prefix.
>
> In Python 3.3 and later, the "py.exe" launcher is installed, and this
> is the association for ".py" files by default. It looks at the #! line
> of .py files, so you can run a specific Python interpreter by giving
> its full path. You can also specify (for example) "python3" or
> "python3.2" to run a specific Python version.

Yes, I've noticed that this nasty launcher gets in the way. So, do you
propose to edit source files every time I need to test them with a new
version of Python? My original user story:

    I want to execute scripts in virtual environment (i.e. with Python
installed for this virtual environment) without 'python' prefix.

Here is another one. Currently Sphinx doesn't install with Python 3.2
and with Python 3.3 [1]. Normally I'd create 3 environments to
troubleshoot it and I can not modify all Sphinx files to point to the
correct interpreter to just execute 'setup.py install'.

A solution would be to teach launcher to honor PYTHON_PATH variable if
it is set (please don't confuse it with PYTHONPATH which purpose is
still unclear on Windows).

1. https://bitbucket.org/birkenfeld/sphinx/issue/1022/doesnt-install-with-python-32-and-33-on



More information about the Python-ideas mailing list