python

 

I don’t know, how actually good is python programming language, but i have heard it is mostly used in scientific computation. So, i started programming database with Python and MySQL. This is how, i have done. First of all, i have installed python in my system. Then after i installed python library for mysql database as,

Then, i installed mysql connector for python from this link dev.mysql.com

Now, my folder structure is like this,

From above, i have created a package called databases by creating __init__.py file, which is blank. Then i created Database class inside mysql.py as,

The above class contains constructor, query processor and destructor respectively. Then i created a main.py as,

I have a table called person with id, name as fields. The above code, selects data from person table and display using for loop. I run my code as,

Cheers!