How to write temporary data to file?
Ravi Teja
webraviteja at gmail.com
Tue Jan 9 01:41:47 EST 2007
Thomas Ploch wrote:
> Hi folks,
>
> I have a data structure that looks like this:
>
> d = {
> 'url1': {
> 'emails': ['a', 'b', 'c',...],
> 'matches': ['d', 'e', 'f',...]
> },
> 'url2': {...
> }
>
> This dictionary will get _very_ big, so I want to write it somehow to a
> file after it has grown to a certain size.
>
> How would I achieve that?
>
> Thanks,
> Thomas
Pickle/cPickle are standard library modules that can persist data.
But in this case, I would recommend ZODB/Durus.
(Your code example scares me. I hope you have benevolent purposes for
that application.)
Ravi Teja.
More information about the Python-list
mailing list