save dictionary for later use?

globalrev skanemupp at yahoo.se
Fri May 16 16:24:30 EDT 2008


On 16 Maj, 21:22, jay graves <jaywgra... at gmail.com> wrote:
> On May 16, 2:17 pm, globalrev <skanem... at yahoo.se> wrote:
>
> > i extract info from one file and put it into a dictionary.
> > i want to save that dictionary for later use, how do i do that?
> > might save a list of dictionaries or a list of classobjects too if
> > there is any difference.
>
> use the 'pickle' module.http://docs.python.org/lib/module-pickle.html
>
> ...
> Jay Graves


pickle.dumps(mg)
pickle.load(mg)

'dict' object has no attribute 'readline'
dumps load(well i dont know but i get no complaint but running load
generates that error)



More information about the Python-list mailing list