py_compile

Routine to “compile” a .py file to a .pyc (or .pyo) file.

This module has intimate knowledge of the format of .pyc files.

Functions

compile(file[, cfile, dfile, doraise]) Byte-compile one Python source file to Python bytecode.
main([args]) Compile several source files.
wr_long(f, x) Internal; write a 32-bit int to a file in little-endian order.

Exceptions

PyCompileError(exc_type, exc_value, file[, msg]) Exception raised when an error occurs while attempting to compile the file.