How to make python scripts .py executable, not bring up editor

Mike Driscoll kyosohma at gmail.com
Tue Jul 8 10:05:07 EDT 2008


On Jul 7, 4:56 pm, korean_dave <davidrey... at gmail.com> wrote:
> From command Prompt, i type in a script,  "tryme.py".
>
> This, instead, brings up PythonWin editor and Interactive Window.
>
> Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5)
>
> How do I make it so that the script runs?

You need to add python.exe to your system's path. In Windows XP, you
need right-click "My Computer", choose Properties, and then the
Advanced tab. Click the Environment Variables button. Then go to the
System Variables section and double-click the Path entry (you may have
to scroll down to get to it).

Notice that everything in this list is separated by semi-colons. You
should be at the end of the list, so just put a semi-colon at the end
and then type C:\Python24

Then it should work. You'll probably need to restart your command line
window though, as it doesn't always take affect on open windows.

HTH

-------------------
Mike Driscoll

Blog:   http://blog.pythonlibrary.org
Python Extension Building Network:     http://www.pythonlibrary.org



More information about the Python-list mailing list