files and reading from them

Delaney, Timothy tdelaney at avaya.com
Mon Mar 25 01:44:07 EST 2002


> From: Avi Homes [mailto:Moo at houston.rr.com]
> 
> I am writing a dictionary to a file, like so
> f.write(str(Info))
[snip] 
> What i would like to do is pull a readline or somesuch.. and 
> have it take in
> the whole thing, and then just let me assign that to a empty 
> name, and turn
> it into a new dictionary.. like say
>  file.seek(1)
> //thats how i'd go to the first place in the file correct?
> X=file.readline()

Look up 'pickle' and 'cPickle' in the python reference.

Tim Delaney




More information about the Python-list mailing list