This commit is contained in:
DavidOnTop 2024-12-06 08:54:05 +01:00
parent 65411da66c
commit b865ea307e
No known key found for this signature in database
GPG key ID: 5D05538A45D5149F
2 changed files with 41 additions and 1 deletions

View file

@ -1 +1,13 @@
pub fn main() {}
use std::ffi::CString;
use pyo3::ffi::c_str;
use pyo3::prelude::*;
static code: &'static str = include_str!("u6.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();
})
}