#! Question

Josiah Carlson jcarlson at nospam.uci.edu
Fri Feb 20 01:03:21 EST 2004


> You should have python.exe in you path. In any event, the space in 
> "Program Files" is sure to cause trouble. Put anything with spaces 
> inside double quotes.
> #!"C:/Program Files/Python2.3.3/python.exe" will work.

Not on windows.  On windows, no amount of #! trickery will get you 
anywhere (unless you are using bash, sh, etc. in windows via cygwin). 
For good or evil, windows uses file-extension associations.  That is, in 
order to be able to open a file that is not an executable, shortcut, or 
batch file (exe, com, scr, pif, lnk, bat, cmd, etc.), Windows must have 
the proper association for that file type.

 From windows explorer, double-click on the .py file.  When it pops up 
with, "What should I open this with?" select the the proper python 
executable, and you are home free.

  - Josiah



More information about the Python-list mailing list