ID EN
Built-in Functions

compile

Python 3.11

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

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

See Also

exec() eval() ast compiler options future features compile() compiler_flag _Feature