Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Demo repo showing how to build Python extension using Rust.

License

NotificationsYou must be signed in to change notification settings

code-ape/rust_python_extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo repo showing how to build Python extension using Rust.

Directions

This was built usingrustc 1.4.0-nightly (dcdcc6f6b 2015-08-11) and run onPython 2.7.10. To run with Python3 change the[dependencies.cpython] section that saysfeatures = ["python27-sys"] tofeatures = ["python3-sys"] (note, this is untested). For best results it is recommended to use exactly what I did.

  1. Runcargo build --release
  2. Runpython try_in_python.py

Reason

This repo was created because my initial attempt to use the code Higgs provided didn't work due to very recent changes indgrunwald/rust-cpython andSkylerLipthay/interpolate_idents. Long term I'm sure this will no longer be an issue but for those who want to do this now, this is helpful. Please refer to myCargo.toml to see exactly what versions of these dependencies you'll need to successfully use this. NOTE: for now this repo is using a fork ofinterpolate_idents by dgrunwald, foundhere. There is a PR for these changes to be merged back in, foundhere, which should hopefully soon make this repo unnecessary.

Credit

The example code comes straight from Ewan Higgs post on using Rust cpython crate. For a more detailed look into Higgs work see his blog posthere.

About

Demo repo showing how to build Python extension using Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp