[Python]异常处理

2019-02-13  本文已影响7人  神农架村姑

try:
f = file('non-exist.txt')
print 'File opened!'
f.close()
except:
print 'File not exists.'
print 'Done'

上一篇 下一篇

猜你喜欢

热点阅读