GNU Info

Info Node: (python2.1-lib.info)py_compile

(python2.1-lib.info)py_compile


Next: compileall Prev: pyclbr Up: Python Language Services
Enter node , (file) or (file)node

Compile Python source files
===========================

Compile Python source files to byte-code files.

The `py_compile' module provides a single function to generate a
byte-code file from a source file.

Though not often needed, this function can be useful when installing
modules for shared use, especially if some of the users may not have
permission to write the byte-code cache files in the directory
containing the source code.

`compile(file[, cfile[, dfile]])'
     Compile a source file to byte-code and write out the byte-code
     cache file.  The source code is loaded from the file name FILE.
     The byte-code is written to CFILE, which defaults to FILE `+'
     `'c'' (`'o'' if optimization is enabled in the current
     interpreter).  If DFILE is specified, it is used as the name of
     the source file in error messages instead of FILE.

See also:
     Note: compileall Utilities to compile all Python source files in
     a directory tree.


automatically generated by info2www version 1.2.2.9