In <[EMAIL PROTECTED]>, Daniel Nogradi
wrote:

>> f = open('file.txt','r')
>> for line in f:
>>         db[line.split(' ')[0]] = line.split(' ')[-1]
>>         db.sync()
> 
> What is db here? Looks like a dictionary but that doesn't have a sync method.

Shelves (`shelve` module) have this API.  And syncing forces the changes
to be written to disks, so all caching and buffering of the operating
system is prevented.  So this may slow down the program considerably.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to