Basic Eval
Demonstrates basic PythonEmbed usage: eval(), exec(), PythonValue type conversion, and safe parameter injection with arg().
Key Points
eval()evaluates expressions and returnsPythonValueexec()executes statements in a shared namespacePythonValueprovides typed access:asInt(),asDouble(),asString(),asList(),asMap()PythonEmbed.arg()safely converts Java values to Python literals — no injection risk- PythonEmbed is
AutoCloseable— always use try-with-resources