11day
文件的操作分为读、写、修改
1、读:
f = open(file='D:\新建文本文档.txt',mode='r',encoding='gbk')
data = f.read()
print(data)
f.close()
11day
文件的操作分为读、写、修改
1、读:
f = open(file='D:\新建文本文档.txt',mode='r',encoding='gbk')
data = f.read()
print(data)
f.close()
转载于:https://www.cnblogs.com/fany-mok/p/8245314.html