f=open(ファイル名,'r')
for line in f:
...
例
fid = open('text.txt', 'r')
for line in fid:
print line,
fid.close()