import sqlite3
import datetime
DBname='PrintSrv.DB'
conn=sqlite3.connect(DBname)
conn.execute("PRAGMA synchronous = OFF;")
theCur=conn.cursor()
findTableSql="select * from sqlite_master where type='table' and name='PrintList'"
createTableSql='create table PrintList(iID integer PRIMARY KEY autoincrement,sContent varchar(3000),iStatus integer)'
theCur.execute(findTableSql)
if len(theCur.fetchall())==0:
theCur.execute(createTableSql)
sIDvalue=datetime.datetime.now().strftime('%Y%m%d%H%M%S%f')
insertSql="insert into PrintList(sContent,iStatus) values('{0}',{1})".format(sIDvalue,'0')
theCur.execute(insertSql)
conn.commit()
selSql='select * from PrintList'
theCur.execute(selSql)
print((theCur.fetchall()))
theCur.close()
conn.close()