[Tutor] Best approach to sort data based on several criteria

Jorge Godoy godoy@metalab.unc.edu
Mon Jul 21 12:03:03 2003


Quentin <qsc@icon.co.za> writes:

> OK, I am not going to give you a Python answer, but some ways to

Thank you. I'm not willing to loose all the fun doing things
myself. Any indications on what I can read or how's the most effective
pythonic way of doing things is great. 

> consider, I've done similar things the past few months (I used VB, and
> hope to do it with Python in the future):
> Main thing I would do is to convert the file into a data base. This
> will give you so much more control over reading and editing the
> data. And so much easier to program an app to read and sort a database
> than a large text file. I use MySQL database (another opensource
> project, and it is also supported by Python).

I'm going to do that later with the database, but this is just a
temporary solution until we have the definitive thing
implemented. There we are using PostgreSQL. 

> You can use MySQL admin to create a data base and then write a small
> Python app to read your file data in. ( you can even use Python to
> create a database direct).

I was considering that -- in the very beginning --, but I'm not
willing to use it if it can be avoided. On the other hand, using a
database will solve a lot of problems and it can do the hard job on
sorting and all the rest to me... 


I'll reconsider using it. Maybe my quick hack will be a bit more
elaborated than I was willing... 


Thanks again,
-- 
Godoy.     <godoy@metalab.unc.edu>