Very Stupid Newbie Question Regarding Databases

Anders M Eriksson anders.eriksson at morateknikutveckling.se
Mon Dec 20 05:42:47 EST 1999


On Sun, 19 Dec 1999 23:55:41 GMT, 55wgm_guy at my-deja.com wrote:

>
>Name:
>Email:
>Phone Number:
>(etc)
>
>Im starting to look at the gdbm, dbm, and anydbm modules. However, it
>seems to me that to store records in the above format would require
>some sort of key to retrieve a particular record.  How can the *dbm
>modules do this?

Not really sure what the question is but ;-) And please consider that
I'm also a beginner!

As the key you could eigther use one of the fields that are unique
(e.g email) or create an unique key for each record, e.g. record
number (NB! the key must be a string). It all depends on what you want
to do.

I have gotten the impression that the *dbm modules should not be used
directly(?) You would be better off using the shelve module

// Anders




More information about the Python-list mailing list