Untitled

mail@pastecode.io avatar
unknown
plain_text
3 months ago
510 B
1
Indexable
Never
import sqlite3
import sys
import os

def get_base_path():
    if getattr(sys, 'frozen', False):
        return os.path.dirname(sys.executable)
    else:
        return os.path.dirname(__file__)

database_path = os.path.join(get_base_path(), 'agiliza.db')

conn = sqlite3.connect(database_path)
cursor = conn.cursor()

cursor.execute('''
CREATE TABLE IF NOT EXISTS usuarios (
    id INTEGER PRIMARY KEY,
    nome TEXT NOT NULL,
    senha TEXT NOT NULL
);
''')

conn.commit()
conn.close()
Leave a Comment