Answer the question
In order to leave comments, you need to log in
I get the error data base is locked, what should I do?
I want to check the database, but for some reason I get an error that it is closed
def newMessage_text():
with sq.connect("vebinar.db") as con:
cur = con.cursor()
newMessage = cur.execute("select message_text from admin where telegram_id = '631914657' ")
newMessage = cur.fetchone()[0]
prevMessage = cur.execute("select prev_message_text from admin where telegram_id = '631914657' ")
prevMessage = cur.fetchone()
if prevMessage != newMessage:
print('+')
cur.execute(f"update admin set prev_message_text = '{newMessage}' where telegram_id = '631914657' ")
elif prevMessage == newMessage:
print('-')
time.sleep(5)
newMessage_text()
newMessage_text()
Answer the question
In order to leave comments, you need to log in
The error data base is locked is falling, what to do
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question