| 1 |
use pyo3::prelude::*; |
| 2 |
|
| 3 |
fn main() -> PyResult<()> { |
| 4 |
Python::with_gil(|py| { |
| 5 |
let builtins = py.import("builtins")?; |
| 6 |
let total: i32 = builtins.getattr("sum")?.call1((vec![1, 2, 3],))?.extract()?; |
| 7 |
assert_eq!(total, 6); |
| 8 |
println!("Hello, world!"); |
| 9 |
Ok(()) |
| 10 |
}) |
| 11 |
} |