Re: [Tutor] Shelve: remove dictionary from list

2009-03-04 Thread Timo
Kent Johnson schreef: On Tue, Mar 3, 2009 at 12:18 PM, Timo wrote: Hello all, I'm using the Shelve module to store dictionaries in a list as a value of a key. So: key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}] The problem is I can't remove a dictionary from the list. import

Re: [Tutor] Shelve: remove dictionary from list

2009-03-03 Thread Kent Johnson
On Tue, Mar 3, 2009 at 12:18 PM, Timo wrote: > Hello all, I'm using the Shelve module to store dictionaries in a list as a > value of a key. > > So: > > key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}] > > The problem is I can't remove a dictionary from the list. > > > import shelve > >

[Tutor] Shelve: remove dictionary from list

2009-03-03 Thread Timo
Hello all, I'm using the Shelve module to store dictionaries in a list as a value of a key. So: key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}] The problem is I can't remove a dictionary from the list. import shelve s = shelve.open('file') try: for index, value in enumerate(s[