python第27篇之--异常
来源:互联网 发布:it项目经理岗位职责 编辑:程序博客网 时间:2024/06/15 14:46
#!/usr/bin/pythontry: text = input('Enter something-->')except EOFError: print('Why did you do an EOF on me?')except KeyboardInterrupt: print('You cancelled the operation.')else: print('You entered {0} haha'.format(text))
结果:
ang@ubuntu:a_byte_python->./6try_catch.py Enter something-->^CYou cancelled the operation.ang@ubuntu:a_byte_python->./6try_catch.py Enter something-->0You entered 0 haha
阅读全文
0 0
- python第27篇之--异常
- python第28篇--异常
- Python基础教程之第8章 异常
- python第15天:异常
- 《Python基础教程》读书笔记(3)之第8章异常(关键词:Python/异常/try/except/finally)
- 《Python学习手册》学习笔记(32)之第32章异常基础(关键词:编程语言/Python/异常)
- 《Python学习手册》学习笔记(33)之第33章异常编码细节(关键词:编程语言/Python/异常)
- python之异常处理
- Python小贴士之异常
- python学习之异常
- Python学习之异常
- python学习之异常
- Python之异常处理
- Python学习之异常
- python自学之异常
- python基础之异常
- Python学习之异常
- Python之异常
- Python基础——高级特性
- python第26篇之--文件IO
- 兄弟郊游问题
- Flask Web开发 表单
- 修改、编译IDA 6.8 插件 Class Informer 2.4
- python第27篇之--异常
- About of jcl
- TCP/IP协议栈源码冰山一角图
- python第28篇--异常
- Ruby语言基础
- Git之路——配置SSH免密码登录
- LINUX 命令详解
- . Ubuntu15.04设置自动锁屏时间
- 贪心之小船过河问题