[Python]异常处理
2019-02-13 本文已影响7人
神农架村姑
try:
f = file('non-exist.txt')
print 'File opened!'
f.close()
except:
print 'File not exists.'
print 'Done'
try:
f = file('non-exist.txt')
print 'File opened!'
f.close()
except:
print 'File not exists.'
print 'Done'