Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graup/rusty-python
Testing Python <> Rust bindings
https://github.com/graup/rusty-python
Last synced: 29 days ago
JSON representation
Testing Python <> Rust bindings
- Host: GitHub
- URL: https://github.com/graup/rusty-python
- Owner: graup
- Created: 2015-05-16T22:34:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-20T22:37:36.000Z (over 9 years ago)
- Last Synced: 2024-10-14T13:07:17.458Z (2 months ago)
- Language: Python
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rusty Python
This is a test repo to try out different ways of interfacing Python and Rust.
I was heavily inspired by [this blogpost](https://avacariu.me/articles/calling-rust-from-python.html) and random googling around. At some point I thought it would be nice to put together everything I had learned.
## How to run
cargo build --release
python test.py## What this shows
[Rust Inside Other Languages](http://doc.rust-lang.org/1.0.0/book/rust-inside-other-languages.html), the example being Python.
At the moment this is about using Rust code as a library inside Python, so this does the following:
- Calling a Rust function passing parameters, e.g. pointers to lists
- Modifying the referenced objects inplace (i.e. Rust accessing the same memory)
- Returning new objects in Rust, passing them back to Python