Re: bsddb for simple database [very basic]
by Skip Montanaro other posts by this author
Aug 27 2001 1:25AM messages near this date
Re: bsddb for simple database [very basic]
|
Re: Help: using msvcrt for file locking
Artur> Ignacio Vazquez-Abrams wrote:
> > On 26 Aug 2001, Artur Skura wrote:
> >> etc, I will just have standard dictionary pairs, with strings.
> >> I need records. How do I do that?
> >
> > "Keys and values must be strings, however, so to use other objects as keys or
> > to store other kinds of objects the user must serialize them somehow,
> > typically using marshal.dumps or pickle.dumps."
> >
> > You wanted very simple database functionality, you found it. Anything more
> > complex is up to you.
Artur> OK, I will use dumps/loads. I just thought there might be a more
Artur> transparent way, maybe with another db module.
You might want to check out the shelve module. The keys must still be
strings, but it transparently handles serialization of the values.
--
Skip Montanaro (skip@pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Artur Skura
Skip Montanaro
|