newbie question: temporarily store data

Alex Martelli aleaxit at yahoo.com
Thu Oct 12 16:38:27 EDT 2000


"Bryan BZ" <bryanbz at yahoo.com> wrote in message
news:T9nF5.148$B_2.11385 at iad-read.news.verio.net...
> I am looking to store data read in from a file into a cache to dump at a
> later time into a database.  Should I use the "pickle" or "shelve"
> functions?  If not, any suggestions?

The so-called "cache" must be another file?  What is the advantage of
reading it from somewhere to temporarily write somewhere else...?

Anyway, if there is structure in the data that you want to preserve,
cPickle with the binary option may be fastest; else, a simple .write
to the so-called "cache" (and then a .read back from it again later),
e.g. if it's just a huge string that you want to stash away somewhere.


Alex






More information about the Python-list mailing list