文章目录
一、文件
1) 读取
2) 写入
读取
with open("new.txt") as fb:
写入
with open("new.txt","w") as fob:
附加
with open("new.txt","a") as fob:
二、异常
try-except语块
try:
print(4/0)
except ZeroDivisionError:
print("no divide zero")
2022-05-03 11:59:36