faqts : Computers : Programming : Languages : Python : Snippets

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 8 people (100%) answered Yes
Recently 4 of 4 people (100%) answered Yes

Entry

Generating bytecode

Jul 5th, 2000 09:59
Nathan Wallace, Hans Nowak, Snippet 43, Charles G Waldman


"""
Packages: arcane_arts.bytecode
"""

"""
> What is the standard way of compiling a source file into bytecode?
> (I'm sure I should know this, but...) AFAICS there is no option that
> makes python do this from the command line...

python -c "import sourcefile"


will load sourcefile.py and produce sourcefile.pyc

(When modules are imported they are automatically bytecompiled)
"""