f = open("1.txt", "r")
while True:
line = f.readline()
if line:
else:
break
f.close()
python 读取文件基本格式
转载于:https://www.cnblogs.com/52hadoop/p/3455386.html
f = open("1.txt", "r")
while True:
line = f.readline()
if line:
else:
break
f.close()
转载于:https://www.cnblogs.com/52hadoop/p/3455386.html