Oct-15-2018, 06:45 PM
I am very new to any GUI coding. I chose to work with Tkinter instead of PyQt. I have the basics down as far as the foundation of the GUI and have begun to make each separate frame. One of these frames will be for viewing generated invoices. The problem that I am encounter though is populating the data to the correct layout. I have data populated in the tree widget currently, but it is complete messed up. I have attached an image below. Here is the code I am currently working with. It's not a lot, I just can't figure out for the life of me what changes I need to make.
imp_df = pd.read_csv(r"V:\Invoices\Test Invoices.csv") class ViewDataFrame(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) tk_table = ttk.Treeview(self, columns=imp_df.columns.values) tk_table.heading('#0', text='Invoice Number') tk_table.heading('#1', text='Invoice Date') tk_table.heading('#2', text='Description') tk_table.heading('#3', text='Quantity') tk_table.heading('#4', text='Class') tk_table.heading('#5', text='Job') tk_table.heading('#6', text='Terms') tk_table.heading('#7', text='Items') tk_table.heading('#8', text='Amount') tk_table.heading('#9', text='PO Number') tk_table.heading('#10', text='Memo') tk_table.heading('#11', text='IsToEmail') def list_df(): for each_rec in range(len(imp_df)): tk_table.insert("", tk.END, values=imp_df.loc[each_rec])