全世界都在学python-打开文件

with open('’a.txt','r') as f:
f.read()
其中"r"位置的取值可以为:
r,rb,r+,rb+,w,wb,w+,wb+,a,ab,a+,ab+
r:只读
w:覆盖写
a:追加
b:二进制

posted @ 2020-05-13 15:24  IT-初学者  阅读(148)  评论(0编辑  收藏  举报