【Python】-读取txt文件
简单读取:
f=open(r'F: est.txt','r')
将读取的内容存为list:
f=open(r'F: est.txt','r')
arr=[]
for lines in f:
arr.append(lines)
f.close()
简单读取:
f=open(r'F: est.txt','r')
将读取的内容存为list:
f=open(r'F: est.txt','r')
arr=[]
for lines in f:
arr.append(lines)
f.close()