2019-09-21 读取某行数据
2019-10-08 本文已影响0人
spiderzzZ
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就相当于将文件分成了行,然后还是需要遍历来获取所有的行。