From: Peter Otten on
Gabor Urban wrote:

> thanks for the ideas. Here you are the code. Not transcoded from Java
> for I do not know Java enough..
> I am scanning an XML file, and have a large ammount of logging.
> Any ideas are wellcome as before....
> Thnx
> Code:>

> packages.append(Package)

Replace Package (the class) with package (an instance).

> for i in xrange(oplines.length):
> data.append(oplines[i])

Python lists don't have a length attribute. You can determine their length
with len(oplines). To iterate over the items of a list you need not know the
list's length:

for line in oplines:

which can be simplified to



PS: Rrread the tutorial