Demonstrates basic PythonEmbed usage: eval(), exec(), PythonValue type conversion, and safe parameter injection with arg().
:fontawesome-brands-github: View source
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
./gradlew :python-embed-examples:basic-eval:run