February 25th, 2004, 05:10 PM
My python editor comes with a compiler but I don't know how to use the compiler??!!??
I am using Python 2.2.3 that I got from a friend. Now the tutorial says some thing about having to have a command in the command line that will compile it well i have tryed anything I can but it still won't work. I want to compile this neat program I made and it just won't compile.
February 25th, 2004, 05:36 PM
Being an interpreted language Python programs don't need to be compiled to run. So If you want to run a the Python program then fire up you're command line and...
Note: this example was taken from Microsoft Windows XP but the consept is the same on *nix . On Windows you can also run Python programs by double clicking on the file you want to run.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Mark>cd c:\python
You might also be interested in upgrading you're Python version to the latest version (2.3.3). You can find this and much more at:
Hope this has helped clear things up for you,
February 25th, 2004, 08:13 PM
Well I know how to run the program it is just i am not entirely sure on how to compile it with Python interperter 2.2.3.
February 26th, 2004, 02:56 AM
February 26th, 2004, 04:03 AM
When you run the "program.py" file Python automatically
compiles the text to bytecode and store it in memory. It is the bytecode that is actually run by Python. If your program imports another file then this file is also converted to bytecode but the bytecode is stored in .pyc files.
Bytecode is like a halfway house between plain text and real machine code.
To make a stand alone program .exe file you need other tools like py2exe and installer. But these are only needed if you plan to send your program to friends who do not have Python installed Even these .exe programs still run the bytecode! It is just that they bundle Python and the bytecode into one big file.
Last edited by Grim Archon; February 26th, 2004 at 06:52 AM.
Reason: removed stupid error!