问题
Currently the bug seems to be loosening it's position from my project. I have a last bug which I need to fix in order to complete my project.
Code looks like this:
c.execute("SELECT * FROM c20 WHERE Position = 'chain';")
data1 = c.fetchall()
c.execute("SELECT * FROM c20 WHERE Position = 'center';")
data2 = c.fetchall()
c.execute("SELECT * FROM c20 WHERE Position = 'Total';")
data3 = c.fetchall()
data1 = p_mod.list_multiply(data, int(copies_data))
data2 = p_mod.list_multiply(data2, int(copies_data))
data3 = p_mod.list_multiply(data3, int(copies_data))
meta_data = [data1, data2, data3]
n = 0
while n != 3:
for i in meta_data:
my_tree.insert(parent="", index="end", iid=n, text=f"{n + 1}", values=i)
n += 1
if n == 3:
my_tree.pack(pady=20)
root1.mainloop()
The first input got displayed successfully inside the treeview. But the following inputs were not displayed inside the treeview widget. The input for the second 'data2' is:
[('center', 111, 413, 41, 62, 49, 35, 378, 1, 1, 3, 4, 12, 12, 8, 0, 0, 0)]
The p_mod() Code:
def list_multiply(list_input, number):
new_list = tuple(int(x)*number for x in list_input[1:])
return (list_input[0],) + new_list
Where am i getting wrong? Thanks in advance!
来源:https://stackoverflow.com/questions/65735774/why-is-my-treeview-in-the-tkinter-shows-this