Ich habe eine einfache Routine bekam, die nieWie beendet man eine While-Schleife in Python?
import sys
infile = sys.argv[1]
outfile = sys.argv[2]
count=1
print 'Input file is ', infile
print 'Output file is ', outfile
instream = open(infile,'r')
while True:
line=instream.readline()
if line[0:5]=='<?xml':
print 'new record', count
count=count+1
if line == "eof":
print 'end'
break
beendet Diese Infield liest ... aber nie endet. Was muss ich tun?