Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3
- __author__ = 'deadmarshal'
- import sqlite3 as sqlite
- from tkinter import *
- from tkinter import ttk
- ##db tbl name: Words
- ##db first field name: Esperanto
- ##db second field name: English
- #sqlite
- db = sqlite.connect(r'/home/deadmarshal/Desktop/test.db')
- cur = db.cursor()
- cur.execute('select * from Words')
- for row in cur:
- print(row)
- rows = cur.fetchall()
- display_rows = []
- for row in rows:
- display_rows.append(str(row([0] + '' + str(row[1]))))
- #GUI
- root = Tk()
- frame1 = ttk.LabelFrame(root)
- frame1.config(height=200, width=300, text= "Words")
- frame1.pack(side=LEFT, anchor='nw')
- frame1.config(padding = (3, 5))
- entry = ttk.Entry(frame1, width=30)
- entry.grid(row=0, column=0)
- list = Listbox(frame1, height=10)
- s = Scrollbar(frame1, orient=VERTICAL)
- list.configure(yscrollcommand=s.set)
- list.grid(row=1, column=0)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement