https://www.cnblogs.com/ymjyqsx/p/6554817.html
https://www.cnblogs.com/gengyufei/p/11341853.html
f = open(path, 'r') # 只读
f = open(path, 'w')# 写文件
f.read() #读取全部文件
f.close() #关闭文件
with open('path', 'r' or 'w' ) as f :
data = f.read()
or:
for line in f.readlines():
print(line.strip()) # 把末尾的'\n'删掉