flask/mod/sqlite/index.py

25 lines
715 B
Python
Raw Normal View History

2023-11-06 18:49:47 +05:00
import sqlite3
class sqlite:
def __init__(self):
conn = sqlite3.connect('bd/db.db')
self.cur=conn.cursor()
#self.cur.execute("SELECT * FROM users;")
#one_result = self.cur.fetchone()
#print(one_result)
def install(self, tab, pole):
try:
self.cur.execute("ALTER TABLE " + tab + " ADD COLUMN " + pole)
except:
pass
def newtable(self, txt):
try:
self.cur.execute(txt)
except:
pass
#https://nizhniy-tagil.leader-t.ru/catalog/zashchita-ruk/
#https://nizhniy-tagil.leader-t.ru/catalog/obtirochnye-materialy/
#https://nizhniy-tagil.leader-t.ru/catalog/rukavitsy/