A playground to test how well python and rust work together.
- python > 3.9.x
- rust > 1.50.x
- The Rust function must be built.
- The
myrustlib.so
can be imported intopython_and_rust.py
. - The script can be tested.
cd ./pyext-myrustlib/ && cargo build --release
cd ..
cp ./pyext-myrustlib/target/release/libmyrustlib.so ./myrustlib.so
python python_and_rust.py
The commands are also integrated for debugging in vscode.
- Rust bindings for the python interpreter https://github.com/dgrunwald/rust-cpython.
- This repo was inspired by https://github.com/rochacbruno/rust-python-example.