[−][src]Macro inline_python::python
python!() { /* proc-macro */ }
A block of Python code within your Rust code.
This macro can be used in three different ways:
-
By itself as a statement. In this case, the Python code is executed directly.
-
By assigning it to a
Context
. In this case, the Python code is executed directly, and the context (the global variables) are available for re-use by other Python code or inspection by Rust code. -
By passing it as an argument to a function taking a
PythonBlock
, such asContext::run
.
See the crate's module level documentation for examples.