You are here : python_3Built-in Functionscompile

compile() - Built-in Functions

Compile the source into a code or AST object.  Code objects can be executed
by exec() or eval().  source can either be a normal string, a
byte string, or an AST object.  Refer to the ast module documentation
for information on how to work with AST objects.


Syntax

compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference