How do I work with the Qt data base in Python?
I'm beginning with PyQt and heard that the Qt comes with a special data base module named QtSQL. The docs of the module, like everything in Qt, cover only C++ usage. In my work, I'll need a data base which can be accessed by more than one software by the time (local network). I would like to know if someone works with the QtSQL and could give some tips of how to learn more about it. Is it possible to work with it in local network开发者_StackOverflow中文版? Is it ready-to-use when the PyQt4 is installed or do I need to install something more? And what about the license?
Yes, PyQt
supports QtSql
. Note that it's not a database in itself, but rather a unified interface to database libraries:
The QtSql module contains classes that integrate with open-source and proprietary SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
So you should tie it in to an existing database such as MySql. Note that Python also has its own APIs for databases available, so you'll have a choice here.
The license for PyQt
is GPL.
As for how to learn more about it, I would suggest to first learn about databases in general and try to understand your requirements and what DB you need to fulfill them. Once you understand that, picking the Python DB binding should be easy.
精彩评论