This commit is contained in:
DavidOnTop 2025-04-16 08:43:11 +02:00
parent ae70fd2920
commit 44c0c9ad68
Signed by: DavidOnTop
GPG key ID: 8D3E9A75E3E13D89
5 changed files with 83 additions and 5 deletions

View file

@ -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();
})
}