[Tutor] Fw: Please submit to tutor list: dictionary update prob

Kent Johnson kent37 at tds.net
Thu Jan 20 05:25:17 CET 2005


Jacob S. wrote:
>> sorry to send this to you but if you may, kindly send to tutor list as im
>> no longer subscribed.  my problem is in the update dict portion: it just
>> doesnt update regardless how many contacts i add. kindly advise where
>> my mistake is or code gone wrong. the rest of the options i will do on my
>> own so just hold off the helps for now. appreciate all your good help.

>> def update_dict(d, f):
>>    ''' update the saved dictionary file '''
>>
>>    read = open(f, 'rb')
>>    newdic = cPickle.load(read)
>>    newdic.update(d)
>>    read.close()

You don't do anything with newdic. My guess is you want to dump it back to the file so it is saved.

Kent



More information about the Tutor mailing list