def func(): try: n1 = int(input('number1:')) with open('./a2.txt','r') as p: print(p) except ValueError: print('this is not a number') except Exception as err: #打出错误原因 print(err) print('----------------------') func()
def func(): try: n1 = int(input('number1:')) with open('./a2.txt','r') as p: print(p) except ValueError: print('this is not a number') except Exception as err: #打出错误原因 print(err) print('----------------------') func()