You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to call a pyfunction implemented in PyO3 from the same rust program?
For example:
#[pyfunction]fnone() -> f32{1.}fnmain(){let gil = Python::acquire_gil();let py = gil.python();// I'd like to call the function like this:
py.run("print(one())");}
In a binary crate, it seems that the functions are not loaded automatically by the #[pyfunction] macro, but I couldn't find a way to load them manually either.
I use the latest stable versions of Rust and PyO3.
The text was updated successfully, but these errors were encountered:
qt2
changed the title
How can I call
Call a pyfunction implemented in PyO3 from the same rust program
Apr 21, 2021
Is it possible to call a pyfunction implemented in PyO3 from the same rust program?
For example:
In a binary crate, it seems that the functions are not loaded automatically by the #[pyfunction] macro, but I couldn't find a way to load them manually either.
I use the latest stable versions of Rust and PyO3.
The text was updated successfully, but these errors were encountered: