nac3/nac3embedded/src/lib.rs
2020-12-18 10:09:35 +08:00

15 lines
298 B
Rust

use pyo3::prelude::*;
use pyo3::wrap_pyfunction;
#[pyfunction]
fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
Ok((a + b).to_string())
}
#[pymodule]
fn nac3embedded(py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
Ok(())
}