An Intro to
Programming
with Python

Fall 2006
course
navigation

Making something almost useful in Python on Windows

This page will briefly discuss what you can do with Python in Windows that Mac and Linux gets more or less for granted; also how to get two types of .exe files.
To be able to run Python from the Windows command prompt, you'll have to add the location of the Python executable to your path. To do this, right click on My Computer, click Properties, go to Advanced, and in the box of System Variables, edit the variable Path and put the path of your Python executable. If you have Python 2.4, that path would be c:\python24, and you would put ;c:\python24 at the end of the list. For Python 2.5, add ;c:\python25. This will let you run Python from the command line by merely typing "python" and run python programs by typing "python (program name)".
Now, you've made a nifty Python program that you want to be able to run as an .exe and pass around to other people who don't have Python installed. The instructions in the official documention recommend compiling things from source with MSVC++ and get a bit complicated. To work around that, there are a few programs. Py2Exe will take a .py file and make a standalone executable. If you try it, be sure to read their tutorial.
If Py2Exe isn't cool enough for you, there's ShedSkin, which takes basic Python programs and converts them to optimized C++ code. This, in the rare case that you're doing something performance-intensive, will give quite a performance boost, if you can handle compiling C++ code (I recommend GCC MingW, a Windows port of the GNU C Compiler).