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