use stdpython :: * ; pub fn python_main () -> Result < & 'static str , PyException > { print (& ("Main function")) ; return Ok ("result") ; } fn main () { let __rython_result = (|| -> Result < () , PyException > { let result ; ; print (& ("Starting program")) ; result = python_main () ? ; ; print (& (format ! ("Result: {}" , py_display (& (result))))) ; print (& ("Program finished")) ; Ok (()) }) () ; if let Err (e) = __rython_result { eprintln ! ("{}" , e) ; std :: process :: exit (1) ; } }