Friday, December 17, 2010

Database Project

I'm a compulsive DIY addict. Which is a bad habit when it comes to coding. There are a lot of other foundations out there that I could learn to use (and which are better than anything I could create), but either for pride or a desire to control everything, I find myself writing as much code from scratch as I can. This is an example.

I spent the afternoon writing a Database class and a DatabaseGUI class (both in Python) so I can adapt them later on in my MusicExplorer project (I'll probably explain this project in a later post--and hopefully change this to a link). Such things probably exist, but I like to create them myself so I can micromanage every aspect of my projects.

So far both classes are working well. The DatabaseGUI class basically has a single method which sets up its parameters "db_rows" and "db_cols" which are lists representing the database data and the column names respectively. It currently sets up an instance of the Database class and queries it for its row/column-name data. The GUI class then sets up the graphical user interface and loads in the data. As of now, the Database class has a "populate_table()" method that creates a random number of rows and columns and then randomly propagates them with words from a Bible text file.

When I finish solidly developing these classes, I'll start working on MusicExplorer.py.

No comments:

Post a Comment