pyqt5最简单操作数据库
时间:2021-07-01 10:21:17
帮助过:72人阅读
PyQt5.QtSql as sql
db=sql.QSqlDatabase.addDatabase(
‘QMYSQL‘)
db.setDatabaseName(‘test1‘)
db.setUserName(‘root‘)
db.setPassword(‘123‘)
db.open()
query=sql.QSqlQuery(
‘select * from a1‘)
query.first()
for i
in range(query.size()):
print(query.value(0),query.value(1
))
query.next()
db.close()
pyqt5最简单操作数据库
标签:val next 技术分享 最简 span mysq query lda word