- I want it to be a simple database with simple interface where you can add records to a given table and then view your "notes" or "Refcards";
- The idea is to have a GUI to flip through Refcards in the database;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import os | |
from Tkinter import * | |
root = Tk() | |
S = Scrollbar(root) | |
T = Text(root, height=8, width=75) | |
S.pack(side=RIGHT, fill=Y) | |
T.pack(side=LEFT, fill=Y) | |
S.config(command=T.yview) | |
T.config(yscrollcommand=S.set) | |
os.chdir('C:\\FILEPATH') | |
conn = sqlite3.connect("refcards2019.db") | |
cursor = conn.cursor() | |
sql = "SELECT * FROM refcards" | |
cursor.execute(sql) | |
# note = cursor.fetchone()[2] | |
note = cursor.fetchall()[1][2] | |
T.insert(END, note) | |
mainloop( ) | |
conn.close() |
No comments:
Post a Comment