#! Question

Scott David Daniels Scott.Daniels at Acm.Org
Fri Feb 20 15:25:37 EST 2004


Ian Pellew wrote:

> How do I get line one to call python:-
> This is line one in my python script 
> #!C:/Program Files/Python2.3.3/python.exe

As Josiah Carlson pointed out, the mechanism on windows is
different.  You can figure out how to do this in the command
line environment by typing "HELP ASSOC" and "HELP FTYPE".
Essentially, there is a two-layer association between file
extensions and programs.  ASSOC sets the association of an
extension with a file type.  FTYPE associates a file type
with a command.

So, after typing the following to your command processor:

     ASSOC .py=Python.File
     FTYPE Python.File=C:\python23\python.exe %1 %*

You should be able to run python files by simply typing their
name (assuming a standard python 2.3 install on drive C).

-- 
-Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list