reconstruct list and dictionary from file

Steve Perry richardlee2061 at yahoo.com
Mon Aug 16 03:13:43 EDT 2004


Thanks for the reply. I noticed the execfile method, but unfortunately,
the file format is predetermined.

Any soultions? - thanks!

Steve

> Steve Perry wrote:
> 
> >I have a serialized list and dictionary stored in a file, with the
> >following format:
> >
> >mydata:
> >   color ["red" "green" "blue"]
> >   origin [0.0 13.2 9.2]
> >   datasource1 {server:"server1.domain" username:"client"
> >password:"secret"}
> >
> >  
> >
> Is the above format the only way you want to store the serialized
> list? 
> I ask because (and in case
> you aren't already aware of the 'execfile' method), if you can store 
> 'mydata' in the form of legal Python expressions,
> you can use the 'execfile' method to  create live objects out of the 
> data-structures stored in the list.
> 
> Regards,
> Satchit,
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the Python-list mailing list