Is it possible to call Rust from python script and how?


#1

can we use something like ctypes or cffi which calls C++ from python ?


#2

Yes, that’s one way to do it. The other is to use python bindings:


#3

This post has examples using cffi in Python for numerical type work. If you use this as a reference, make sure to note the comment on using std::slice::from_raw_parts and the correction related to the _as_f64_array python function in the example.