pyo3/examples/hello.rs
2015-04-19 00:39:04 +02:00

13 lines
298 B
Rust

extern crate cpython;
use cpython::{PythonObject, Python};
fn main() {
let gil = Python::acquire_gil();
let py = gil.python();
let sys = py.import("sys").unwrap();
let version: String = sys.get("version").unwrap().extract().unwrap();
println!("Hello Python {}", version);
}