add try catch output in C Sharp and correct pythonGenerator