遇到一个问题,还没找到原因,不晓得原理是什么,先mark一下
import os
with open('/root/training-data/photos/images-1000/train.csv','r') as f:
header = f.read().splitlines()[0] # line 1
info = f.read().splitlines()[1:] # line 2
i = 0
for l in info:
print '%s' % l
i += 1
if i > 10:
break
当加上line1时,info就得不到值