0
タイトルとして:forループを使用してファイルのすべての行を印刷した後、別のforループでファイルを印刷できません。Pythonのopen()関数:forループを使用した後、通常はファイルを印刷できません
forループはpos変数を変更しますか?
pos = open('nnn.txt','r')
print pos
count = 0
for line in pos:
line = line.rstrip()
if line.startswith('Hey'):
print line
count += 1
print count
count = 0
print line
for lines in pos:
lines = lines.rstrip()
print lines
count += 1
print count