问题描述
想要快速做异常处理,手写try…except太慢了,在代码很长的情况下更容易出错
def divide(a, b):
return a / b
解决方案
- 选中代码块
- Code→Surround with

- 选择对应模块

- if:判断,if True:
- while:判断,while True:
- try / except:捕捉异常
- try / finally:捕捉异常
- <editor-fold…> Comments:标签形式的范围注释
- region…endregion Comments:范围注释
参考文献
来源:CSDN
作者:XerCis
链接:https://blog.csdn.net/lly1122334/article/details/103984515

