Newby: Dictionaries as file objects?

netvegetable deathtospam43423 at altavista.com
Sun Jun 9 09:15:05 CEST 2002


Hi.

I want to be able to store a list on a file object, and I want each list 
item to be a dictionary, complete with its own set of keys and values. 

I know I can store a list in a file object, simply by writing each item to 
the file as a string , and making sure there's a "\n" character at the end 
of it. When I read the file object again, I merely need to open it as 
"open(object).readlines()" and hey presto, my list is back in order.

So is there a way to conveniently store a dictionary in each item as well?

Ta.

-- 
netvegetable at excite.com



More information about the Python-list mailing list