with open(path,'r') as f:
lines = f.read().splitlines
for line in lines
print(line)
splitlines就相当于将文件分成了行,然后还是需要遍历来获取所有的行。
with open(path,'r') as f:
lines = f.read().splitlines
for line in lines
print(line)
splitlines就相当于将文件分成了行,然后还是需要遍历来获取所有的行。
本文标题:2019-09-21 读取某行数据
本文链接:https://www.haomeiwen.com/subject/okkeuctx.html
网友评论