Dynamic Code Execution
eval, exec and compile run Python code from strings — powerful and dangerous.
Intermediate
This is an overview — pick a sub-topic below.
Sub-topics (1)
eval(), exec() and compile()
eval evaluates an expression string, exec runs statements, compile turns source into a code object.
Intermediate♥ 0🔖 0💬 0
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.