[][src]Function pyembed::run

pub fn run(py: Python<'_>, run_mode: &PythonRunMode) -> PyResult<PyObject>

Runs Python code with the specified code execution settings.

This will execute whatever is configured by the passed PythonRunMode and return a PyObject representing the value returned by Python.

This function will use other run_* functions on this module to run Python. Our functions may vary slightly from how python -c, python -m, etc would do things. If you would like exact conformance with these run modes, use OxidizedPythonInterpreterConfig.run_as_main() instead, as that will evaluate using a Python API that does what python would do.