-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
38 lines (27 loc) · 854 Bytes
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from sql import *
from tkinter import *
from tkinter import messagebox, ttk
def execute():
sql = query.get()
result = db.query(sql)
if isinstance(result, str):
messagebox.showinfo("Execution Result", result)
else:
pass
def main():
global db, query, data
db = Database()
base = Tk()
base.geometry("300x300")
base.title("My SQLite Query test")
Label(base, text="My SQLite Query Tester", font=("Times New Roman", 25)).pack()
query_frame = Frame(base)
query = Entry(query_frame)
query.pack(side='left', fill='x', expand=True)
query_button = Button(query_frame, text="Execute", command=lambda: execute())
query_button.pack(side='left')
query_frame.pack()
data = ttk.Treeview(base, show='headings')
base.mainloop()
if __name__ == "__main__":
main()