面试复习-Python-错误与异常
Python中常见的异常
1 | for |
Python的异常处理
1 | try: |
1 | # 捕获所有异常 |
1 | # 忽略所有异常 |
1 | try: |
上下文管理协议
1 | with open('a.txt', 'r') as f: |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 三木的技术博客!
评论
1 | for |
1 | try: |
1 | # 捕获所有异常 |
1 | # 忽略所有异常 |
1 | try: |
1 | with open('a.txt', 'r') as f: |