Answer the question
In order to leave comments, you need to log in
sqlite to aiosqlite?
import sqlite3
import os.path
class Sql:
def __init__(self, database):
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_path = os.path.join(BASE_DIR, "db.db")
self.connection = sqlite3.connect(db_path)
self.cursor = self.connection.cursor()
def task_result(self):
self.cursor.execute(f"""SELECT welcome FROM welcome """)
message = self.cursor.fetchone()[0]
return message
def close(self):
self.connection.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question