Hello to all,
I am having trouble removing an item from list, which the item is a list by itself.
<code>
for self.line in self.filtered:
if self.appid:
if self.line[0] <> self.appid:
print RED + " ".join( map ( lambda x:str(x), self.filtered[self.filtered.i ndex( self.line) ] )) + RESET
self.filtered.r emove( self.line.index (self.line[0] ) )
else:
print "F: " + str(self.line)
self.ci+=1
</code>
I am trying either to remove...but fails or use the del... No chance
Imaging each item in the list is a list itself of 8 fields.
The problem is based on that when loading the data...from csv, the reader's data are passed by reference. Removing with del, gives problem because it has the reference.
In the end what I wish to do is to subtract elements from the list.
I am overload...I don't know if I gave it clear...
Hope somebody helps...
Thank yu
I am having trouble removing an item from list, which the item is a list by itself.
<code>
for self.line in self.filtered:
if self.appid:
if self.line[0] <> self.appid:
print RED + " ".join( map ( lambda x:str(x), self.filtered[self.filtered.i ndex( self.line) ] )) + RESET
self.filtered.r emove( self.line.index (self.line[0] ) )
else:
print "F: " + str(self.line)
self.ci+=1
</code>
I am trying either to remove...but fails or use the del... No chance
Imaging each item in the list is a list itself of 8 fields.
The problem is based on that when loading the data...from csv, the reader's data are passed by reference. Removing with del, gives problem because it has the reference.
In the end what I wish to do is to subtract elements from the list.
I am overload...I don't know if I gave it clear...
Hope somebody helps...
Thank yu
Comment