forked from furas/python-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (29 loc) · 848 Bytes
/
Copy pathmain.py
File metadata and controls
41 lines (29 loc) · 848 Bytes
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
39
40
41
import tkinter as tk
from tkinter import ttk
import sqlite3
# --- functions ---
def get_data():
print('updated')
cursor = db.cursor()
cursor.execute('SELECT title, url FROM moz_places')
db.commit()
# clear all
#track.delete(*track.get_children())
for row in cursor.fetchall():
track.insert('', 'end', values=row)
cursor.close()
#root.after(1000, get_data)
# --- main ---
db = sqlite3.connect('/home/furas/.mozilla/firefox/mwad0hks.default/places.sqlite')
root = tk.Tk()
root.columnconfigure(1, weight=1)
root.rowconfigure(0, weight=1)
track = ttk.Treeview(root)
track["columns"] = ("one", "two")
track.column("one", width=40)
track.column("two", width=70)
track.configure(show='')
#track.configure(height='1')
track.grid(row=0, column=1, sticky="WENS", padx=5)
get_data()
root.mainloop()