#-*-coding:utf-8 import sys try: strInput=int(raw_input(‘input sth.‘)) f=file(‘d:\\kjdsklslkdkl2l23223.datdk‘) except (EOFError,ValueError): #多重异常 print(ValueError.message) print(‘eof or value‘) except: print(‘unknow error‘) else: print(‘good‘)
Python Special Syntax 9 : 异常捕获,布布扣,bubuko.com
时间: 2024-08-31 17:07:17