View Single Post
Old May 27th, 2006, 2:38 PM   #2
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
This is the way to compile a Python file to a byte code file. The byte code file is not easy to read, check it out with an editor.
# create a byte code compiled python file

import py_compile
py_compile.compile("MyFile.py")  # creates  MyFile.pyc
Python will run either the .py file or the .pyc file

The thing with the .py_ doesn't make much sense. If you take a source file like MyFile.py and rename it MyFile.py_ then you still have a source file. A byte code file like MyFile.pyc can be renamed to MyFile.py_, but it is still a byte code file!
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote