Prevent 'try' to catch an exception and pass to the next line in python
问题 I have a python function that runs other functions. def main(): func1(a,b) func2(*args,*kwargs) func3() Now I want to apply exceptions on main function. If there was an exception in any of the functions inside main, the function should not stop but continue executing next line. In other words, I want the below functionality def main(): try: func1() except: pass try: func2() except: pass try: func3() except: pass So is there any way to loop through each statement inside main function and apply