2015-04-18 22:39:04 +00:00
|
|
|
extern crate cpython;
|
2015-04-18 18:17:25 +00:00
|
|
|
|
2015-04-18 22:39:04 +00:00
|
|
|
use cpython::{PythonObject, Python};
|
|
|
|
|
2015-04-18 18:17:25 +00:00
|
|
|
fn main() {
|
|
|
|
let gil = Python::acquire_gil();
|
|
|
|
let py = gil.python();
|
2015-04-18 22:39:04 +00:00
|
|
|
let sys = py.import("sys").unwrap();
|
|
|
|
let version: String = sys.get("version").unwrap().extract().unwrap();
|
|
|
|
println!("Hello Python {}", version);
|
2015-04-18 18:17:25 +00:00
|
|
|
}
|
|
|
|
|