Untitled
unknown
plain_text
2 years ago
510 B
5
Indexable
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()Editor is loading...
Leave a Comment