>>> try:
... raise KeyboardInterrupt
... finally:
... print('Goodbye, world!')
...
Goodbye, world!
KeyboardInterrupt
Traceback (most recent call last):
File "<stdin>", line 2, in <module>

A finally clause is always executed before leaving the try statement, whether an exception has occurred or not. When an exception has occurred in the try clause and has not been handled by an except clause (or it has occurred in an except or else clause), it is re-raised after the finally clause has been executed. The finally clause is also executed “on the way out” when any other clause of the try statement is left via a break, continue or return statement.

最新文章

  1. Android raw to bmp
  2. canvas时钟
  3. Python的高级特性12:类的继承
  4. CSS3自动添加省略号
  5. 模拟系列(一)&mdash;&mdash;数字电路
  6. iOS UILabel根据字符串长度自动适应宽度和高度
  7. git .gitignore 文件 解决二进制文件冲突问题
  8. CF 295A Greg and Array (两次建树,区间更新,单点查询)
  9. [hackerrank]Even Odd Query
  10. BZOJ 1046 上升序列
  11. 使用Ueditor编辑器上传图片总结;
  12. 容器化系列 - GitLab启动和配置 on Docker
  13. 【Linux】Linux简介
  14. 怎么在多场景下使用不同的 git 账号 commit
  15. 几种方法来实现scp拷贝时无需输入密码
  16. LeetCode 51 N-Queens II
  17. js实现深拷贝的一些方法
  18. 《剑指offer》-栈的压入、弹出序列
  19. Mysql select id 加上order by 后结果不一致
  20. python多进程打印字符,加锁(Lock加锁)

热门文章

  1. sql中使一个字段升序,一个字段降序
  2. Ubuntu查找软件命令
  3. jmeter函数 助手
  4. 开源大数据生态下的 Flink 应用实践
  5. 计算机网络体系之OSI模型
  6. 2018-2019-2 实验三 敏捷开发与XP实践
  7. soj#532 set p3175
  8. 公司-IT-Mercari:Mercari 百科
  9. 如何为元组中的每个元素命名,提高程序可读性---Python数据结构与算法相关问题与解决技巧
  10. 用webdriver模仿浏览器 爬取豆瓣python书单