[Tutor] How should I store data ?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sun Nov 20 07:43:41 CET 2005



On Sat, 19 Nov 2005, Bojan Raicevic wrote:

> I want to store data in the shape of (for example):
>   First name, Last name, Age, ... few more characteristics.
>   I must be able to search data by any of this fields. For example,
> search for age, or name ... etc
>   Also, I want to put option in main program to change (update), add and
> remove that data.
>   How do I do that (easiest way, please) ?

Hi Bojan,

If you're not bound to use Python directly, I'd recommend looking into a
relational database.  Relational databases may solve the problem you're
describing: to search by any field, to handle storage and loading, and to
support those operations efficiently.

There are few free ones available that you can experiment with.  One
popular one is sqlite.

    http://www.sqlite.org/

If you want to then write a nice interface around the database, you can
take advantage of the pysqlite module:

    http://initd.org/projects/pysqlite

If you have more questions, please feel free to ask.



More information about the Tutor mailing list