[][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:

  1. By itself as a statement. In this case, the Python code is executed directly.

  2. 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.

  3. By passing it as an argument to a function taking a PythonBlock, such as Context::run.

See the crate's module level documentation for examples.