使用readline()读文件
f = open("hi.txt",encoding='utf-8')
while True:
line = f.readline()
if line:
print (line)
else:
break
f.close()
f = open("hi.txt",encoding='utf-8')
while True:
line = f.readline()
if line:
print (line)
else:
break
f.close()