How to store data?

John Roth newsgroups at jhrothjr.com
Sat Aug 23 17:36:53 EDT 2003


"Lars Behrens" <Spam.Buster at web.de> wrote in message
news:bi8lqg$6qoh4$1 at ID-95936.news.uni-berlin.de...
> Hi there!
>
> For a web project I need a little expert help. I don't have written much
> code yet, just been fiddling around a bit, testing and planning.
>
> The web site will have a submission page for attendants of a congress.
> In a form the user will submit name, mailadress etc. and I plan to store
> the data in a list of dictionaries:
>
> People = [{'name' : 'Sir Galahad', 'address' : 'Camelot', 'mail' :
> 'Carrierpigeon at england.com'}]
>
> #new attendant:
> People.append({'name' : 'Brian', 'address' : 'Palestine', 'mail' :
> 'fastridingmessenger at rome.com'})
>
> The 'lines' can be accessed by their index.
>
> Now my question: Where do you suggest to store the data? I know that
> something sql-like would be quite useful but I don't have any knowledge
> of sql. So I thought about putting the data either into a comma
> separated file or pickling it.
>
> I should mention that some other people on different operation systems
> should be able to import the file (Excel, Open Office) so I tend towards
> the csv file.
>
> What would be better?

Python 2.3 has an excellent CSV module.

> And another problem: How to lock the file when several users try to
> write to it?
>
> As I'm no very experienced programmer I would appreciate your help,
> thanks in advance

John Roth
>
> Cheerz Lars
>
>
>
>
>
>
>
>
>
>






More information about the Python-list mailing list