Why is my treeview in the tkinter shows this?

时光毁灭记忆、已成空白 提交于 2021-02-11 12:13:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!