MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

16_python_inside_rust/rust/py_in_rust/src/main.rs:4–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use pyo3::types::IntoPyDict;
3
4fn main() -> Result<(), ()> {
5 Python::with_gil(|py| {
6 main_(py).map_err(|e| {
7 // We can't display Python exceptions via std::fmt::Display,
8 // so print the error here manually.
9 e.print_and_set_sys_last_vars(py);
10 })
11 })
12}
13
14fn main_(py: Python) -> PyResult<()> {
15 let sys = py.import("sys")?;

Callers

nothing calls this directly

Calls 1

main_Function · 0.85

Tested by

no test coverage detected