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()