August 3, 2013

Python - GUI and MySQL

Since we are going to deploy the system to consumer level, the interface of our application should be intuitive, more or less, looking the same as with other typical desktop applications. And to some extent, it should resemble our Android App in the design.

We have decided to use MySQL for the database of our application. For web application, I am most certain that PHP would be the best to use. However, we would want a standalone desktop application for our system. The desktop application should be able to execute these 3 main general functions:

   1. Communicate with our MySQL database (of course!)
   2. Communicate with Rpi via bluetooth
   3. Communicate with Android App via bluetooth.

Since we're using Python on Rpi itself, perhaps it's good for me to explore on how we can use Python in this area as well, eliminating the needs for PHP. We basically know that Python bluetooth communication with Rpi and Android App is implementable. So, what I need to know for now are:

How Python can be used to write a desktop application?
What GUI tools do I need?
Can it be installed in main PC platforms (Windows, Linux, Mac)?
How Python can be used along with MySQL database?

A quick research led me to PyQt, a Python way of using cross-platform GUI toolkit, QT. From the Wiki page of PyQt, there are other GUI toolkits available for Python as well. However, we'll stick to PyQt for now due to the fact that it is cross-platform. I have implemented Qt before in my Object Oriented programming course - I wrote a Hang Man's words game and used Qt for the drawing.

Below is the introductory video on PyQt and here is a good tutorial site for PyQt : Link.





I also found out that, similar to PHP, Python can also be used with MySQL with ease. These two links below shows how it is done. I'll try these out later when I want to get started with our desktop application.

Link 1 : Connecting to MySQL with Python and PHP
Link 2 : MySQL Python tutorial

No comments:

Post a Comment

Write a reply