Mar-13-2021, 11:53 AM
Hi All,
I am having troubles with Tkinter and tables.
Tkinter has limited possibilities for creating tables, so I create one with this ' program'.
Now I want the output to show on a canvas on a certain place, let's say x-10, y-20.
Can someone please explain how this must be done?
I have some experience with Tkinter but I don't know how to place this matrix.
Thank you.
Thanks in advance,
Best regards,
Jan van Eeden
Noordwijk
The Netherlands.
I am having troubles with Tkinter and tables.
Tkinter has limited possibilities for creating tables, so I create one with this ' program'.
Now I want the output to show on a canvas on a certain place, let's say x-10, y-20.
Can someone please explain how this must be done?
I have some experience with Tkinter but I don't know how to place this matrix.
Thank you.
Thanks in advance,
Best regards,
Jan van Eeden
Noordwijk
The Netherlands.
# Python program to create a table from tkinter import * a=10 class Table: def __init__(self,root): # code for creating table for i in range(total_rows): for j in range(total_columns): self.e = Entry(root, width=16, fg='blue', font=('Arial',10,'bold')) self.e.grid(row=i, column=j) self.e.insert(END, lst[i][j]) # take the data lst = [('Temp.Strand',a), ('Temp. Kamer',18), ('Temp. Keuken',20), ('Temp. Zee',20), ('Luchtdruk',1020.520), ('Luchtdruk Max',1020.520), ('Datum','22-01-2020 10:30'), ('Luchtdruk Min',1020.520), ('Datum','22-01-2020 10:30'),] # find total number of rows and # columns in list total_rows = len(lst) total_columns = len(lst[0]) # create root window S root = Tk() #root.config(cursor="none") ##root.attributes("-fullscreen",True) root.configure(bg='black') t = Table(root) root.mainloop()