last
This commit is contained in:
parent
ae70fd2920
commit
44c0c9ad68
5 changed files with 83 additions and 5 deletions
16
src/u45.rs
16
src/u45.rs
|
@ -1 +1,15 @@
|
|||
pub fn main() {}
|
||||
use std::ffi::CString;
|
||||
use pyo3::ffi::c_str;
|
||||
use pyo3::prelude::{PyAnyMethods, PyModule};
|
||||
use pyo3::Python;
|
||||
|
||||
static code: &'static str = include_str!("u45.py");
|
||||
|
||||
pub fn main() {
|
||||
Python::with_gil(|py| {
|
||||
let c = CString::new(code.as_bytes()).unwrap();
|
||||
let activator =
|
||||
PyModule::from_code(py, c.as_c_str(), c_str!("main.py"), c_str!("main")).unwrap();
|
||||
activator.call_method("main", (), None).unwrap();
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue