Slide 49
Slide 49 text
https://pyo3.rs/v0.19.1/python_from_rust.html
Python::with_gil(|py| {
let fun: Py = PyModule::from_code(
py,
"def example(*args, **kwargs):
if args != ():
print('called with args', args)
if kwargs != {}:
print('called with kwargs', kwargs)
if args == () and kwargs == {}:
print('called with no arguments')",
"",
"",
)?
.getattr("example")?
.into();
...
})
49