spacepaste

  1.  
  2. __author__ = 'deadmarshal'
  3. from tkinter import *
  4. from tkinter import ttk
  5. import sqlite3 as sqlite
  6. import sys
  7. # Gui
  8. root = Tk()
  9. root.title("Esperanto Dictionary")
  10. entry = ttk.Entry(root, width = 65)
  11. entry.grid(row=0 , column = 0)
  12. entry.insert(0, 'Type here to search')
  13. root.minsize(height=60, width=100)
  14. # Listbox
  15. tList = Listbox(root)
  16. s = Scrollbar(root, orient = VERTICAL)
  17. tList.configure(yscrollcommand = s.set)
  18. # Button
  19. but = Button(root, text = 'Search', foreground = 'Blue')
  20. but.grid(row = 0, column= 1)
  21. # Menu
  22. def Quit():
  23. root.quit()
  24. menubar = Menu(root)
  25. menubar.add_command(label = 'Quit', command = Quit)
  26. root.config(menu = menubar)
  27. # SQLite Connect
  28. def insert_data(self):
  29. db = sqlite.connect('C:\\Users\\deadmarshal\\Desktop\\test.db')
  30. cur = db.cursor()
  31. cur.execute('Select * from words')
  32. tList.insert(END, self)
  33. root.mainloop()
  34.