with open的方法
with open('iris.txt','r') as f:
str_ = f.readline()
while(str_):
print(str_)
str_ = f.readline()
f.readline是1行1行的读 需要1个循环
f.readlines是1次把全部行读出来
with open的方法
with open('iris.txt','r') as f:
str_ = f.readline()
while(str_):
print(str_)
str_ = f.readline()
f.readline是1行1行的读 需要1个循环
f.readlines是1次把全部行读出来