pyo3 0.18.3

Bindings to Python interpreter
Documentation
1
2
3
4
5
6
use pyo3::Python;

fn main() {
    let foo = if true { "foo" } else { "bar" };
    Python::with_gil(|py| py.import(pyo3::intern!(py, foo)).unwrap());
}