View Single Post
Old Aug 31st, 2007, 5:56 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
The short answer is that Python is not a compiled language: it's interpreted. To run your application, type "python thenameofyourapp.py" at the command line, or double-click on the Python script in explorer (assuming you're using Windows).

The longer answer is that Python compiles code on the fly into a custom bytecode format, similar to .NET or Java, and caches this bytecode in pyc files. This makes Python applications faster than they would be in a purely interpreted language. But the Python interpreter is still needed to run these bytecode formats.

In addition, there are the IronPython and JPython projects which integrate with the .NET and Java environments, respectively. IronPython applications can be compiled into executables that only require the .NET libraries to run.

There is also py2exe, which is an application that can turn your Python code into an stand-alone executable by wrapping your code up with a Python interpreter. This allows people without Python installed to run your application. The exes produced tend to have an overhead of about 1 Meg, but I've heard that UPX can shrink them by quite a bit (though I haven't tried it myself).
Arevos is offline   Reply With Quote