[Tutor] Problem caused by installing 2.7.3
eryksun
eryksun at gmail.com
Fri Aug 31 19:57:38 CEST 2012
On Fri, Aug 31, 2012 at 12:49 PM, Richard D. Moores <rdmoores at gmail.com> wrote:
>
> MS Windows 7 Home Premium 64-bit SP1
>
> I have some useful (to me) scripts that I use frequently, that I call
> with Windows shortcut keys. They used to open in a nice cmd.exe window
> I'd configured to my liking. Now I find that they open in the default
> white on black tiny window, C:\Python27\python.exe, which tries to run
> the 3.x scripts in 2.7. How did that change come about, and how can I
> correct it?
.py files are associated (assoc .py) with Python.File (ftype
Python.File), which defines the command to run .py console scripts.
The 2.x installer overwrote the registry keys. If you plan to write
scripts for both 2.x and 3.x, the best solution, IMO, is to install
pylauncher to add shebang support to your scripts:
https://bitbucket.org/vinay.sajip/pylauncher
The simpler of the two installations for you would be
launchwin.amd64.msi. It puts py.exe and pyw.exe in the Windows folder,
so you don't have to muck with PATH. Once installed your scripts will
run with py.exe, which takes care of parsing the shebang and starting
the required interpreter.
You can define additional shebangs in %LOCALAPPDATA%\py.ini (e.g. to
add support for pypy). I think this also works in %APPDATA%\py.ini if
you'd rather use your roaming profile. See the docs for more
information:
https://bitbucket.org/vinay.sajip/pylauncher/raw/tip/Doc/launcher.rst
More information about the Tutor
mailing list