[[pokus3]]
 
import sys
 
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtSql import *
 
db = QSqlDatabase.addDatabase ("QSQLITE")
# db.setDatabaseName (":memory:")
db.setDatabaseName ("test.sqlite")
db.open ()
 
query = db.exec_ ("CREATE TABLE IF NOT EXISTS colors (name TEXT,"
                  "red INTEGER, green INTEGER, blue INTEGER)")
 
db.exec_ ("INSERT INTO colors (name, red, green, blue) VALUES (\"blue\", 0, 0, 255)")
 
db.close ()
 
pokus3.txt · Last modified: 2021/12/09 18:30 by 147.32.8.115
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki