try_except.py
来自「《简明 Python 教程》为 "A Byte of Python" 的唯一指定」· Python 代码 · 共 17 行
PY
17 行
#!/usr/bin/env python
# Filename: try_except.py
import sys
try:
s=raw_input('Enter something --> ')
except EOFError:
print '\nWhy did you do an EOF on me?'
sys.exit() # exit the program
except:
print '\nSome error/exception occurred.'
# here, we are not exiting the program
print 'Done'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?