fork download
  1. from tkinter import *
  2. from tkinter import ttk
  3.  
  4.  
  5. class Application:
  6. def __init__(self):
  7.  
  8. self.tela()
  9. self.frames_tela()
  10. self.Treeview_show()
  11.  
  12. self.window.mainloop()
  13.  
  14.  
  15. def tela(self):
  16.  
  17. self.window = Tk()
  18. self.window.geometry('300x300')
  19.  
  20. def frames_tela(self):
  21.  
  22. self.frame_1 = Frame(self.window, bd=4, bg='#dfe3ee',
  23. highlightbackground='#759fe6', highlightthickness=3)
  24.  
  25. self.frame_1.place(relx=0.02, rely=0.02, relwidth=0.96,relheight=0.96)
  26.  
  27.  
  28. def Treeview_show(self):
  29.  
  30. self.listaCli = ttk.Treeview(self.frame_1, height=3,
  31. column=("coll1", "coll2", "coll3", "coll4"))
  32.  
  33. self.scroll_list = Scrollbar(self.frame_1, orient='vertical', command=self.listaCli.yview)
  34.  
  35. self.listaCli.configure(yscrollcommand=self.scroll_list.set)
  36.  
  37. self.listaCli.heading("#0", text="")
  38. self.listaCli.heading("#1", text="cod")
  39. self.listaCli.heading("#2", text="data")
  40. self.listaCli.heading("#3", text="hora")
  41. self.listaCli.heading("#4", text="valor")
  42.  
  43. self.listaCli.column("#0", width=0)
  44. self.listaCli.column("#1", width=10)
  45. self.listaCli.column("#2", width=45)
  46. self.listaCli.column("#3", width=45)
  47. self.listaCli.column("#4", width=45)
  48.  
  49. self.listaCli.place(relx=0.01, rely=0.1, relwidth=0.95, relheight=0.95)
  50.  
  51. self.scroll_list.place(relx=0.96, rely=0.1, relwidth=0.04, relheight=0.85)
  52.  
  53.  
  54.  
  55.  
  56. Application()
  57.  
Runtime error #stdin #stdout #stderr 0.23s 23696KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter'