摘要:
# 捕获异常,异常之后,代码不再执行 try : a = 1/0 except ZeroDivisionError as e : print('出异常了,原因:',e) except IOError as e: print('IO异常,原因:', e) except ValueError as e: 阅读全文
摘要:
# re 正则表达式 import re import requests with open('youdao.html',encoding='utf-8',mode='r') as f: date = f.read() pattren = re.compile('翻译') # 输入要匹配的内容 r1 阅读全文