From: Peter Otten on 1 Mar 2010 17:12 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: data.append(line) which can be simplified to data.extend(oplines) Peter PS: Rrread the tutorial
|
Pages: 1 Prev: Class attributes / methods lost? Next: Call for Participation: CHR Summer School |