Until a few days ago , my time has been taken up with Open University studying and coursework. Python programming for its own sake has been put on hold, and any programming has been to further my OU course.
I have recently handed in what I believe to be my last piece of coursework. Should I pass this module I will graduate from the OU with a degree in IT and Computing and start looking for a job.
This is all good news. Right now I have nothing urgent to do, so restarting this blog seems like a good idea.
My final project on the course actually involved Python programming, and SQLite. It is a biodiversity database (at least the framework for one - there isn't a great deal of actual data), and my previous post (way back in November last year) guided my choice of software. I wanted to do something similar to a LAMP architecture - Linux (as operating system), Apache (as web server software) , MySQL (as the database) and PHP (for scripts and programs).
What I ended up doing was WASP - like LAMP but each item substituted for an equivalent. Windows (operating system), Abyss (web server) SQLite (for the database) and Python (for the scripts).
Although focussing on only a few aspects of Python, the project did teach me a lot.
SQLite - in my previous post I installed SQLite without really knowing how to use it. This project required me to learn about SQLite - how to set up tables and how to add and change data in those tables. Just as importantly I learned how to use the sqlite3 module to get Python programs to do these things.
Big programs - maybe not full-on commercial application size, but some of the scripts I was writing ended up taking up about 200 lines, or 2-3 sheets of A4 paper, making them the largest I've written. That's when user-defined functions, well-named variables and readable code really helps.
CGI - I had to learn this from scratch. Basically this module allows Python scripts to accept input from web forms across the web. So my project had web pages that users on the other side of the world could see if they know the domain name (http://biodiversity.ddns.net/) thanks to the webserver. These web pages have web forms that allow users on their web browsers to submit information to a python script on my web-serving computer. The CGI module enabled the script to receive this information and act on it.
Creating dynamic web pages - This is usually the domain of PHP (another programming language, favoured among web developers) but it can be done with Python. Dynamic web pages are changeable, depending on inputs and conditions, unlike static web pages that simply produce the same content again and again. The Python scripts use the sqlite3 module to read from the SQLite database and then create web pages using the data from the database.
Anyway, it's good to be back here again.
No comments:
Post a Comment