use stdpython :: * ; pub fn python_main () -> Result < & 'static str , PyException > { print (& ("User-defined main function")) ; return Ok ("from_main") ; } pub fn helper () -> Result < () , PyException > { print (& ("Helper function")) ; Ok (()) } fn main () { let __rython_result = (|| -> Result < () , PyException > { let result ; ; result = python_main () ? ; ; helper () ? ; print (& (format ! ("Result: {}" , py_display (& (result))))) ; print (& ("Additional main block code")) ; Ok (()) }) () ; if let Err (e) = __rython_result { eprintln ! ("{}" , e) ; std :: process :: exit (1) ; } }