def sel_inventory(text_widget): inventory = [] pp = DP.InventoryProcessor('Python210FinalDB.db') sql = pp.build_sel_code() for row in pp.execute_sql_code(sql): inventory.append(DM.Inventory(row[0], row[1])) pp.db_con.commit() pp.db_con.close() text_widget['state'] = 'normal' text_widget.delete(1.0, tk.END) if inventory is None: text_widget.insert("No data available") if inventory is not None: text_widget.insert(tk.END, "InventoryID | InventoryDate\n") for row in inventory: text_widget.insert(tk.END, str(row) + "\n") text_widget['state'] = 'disabled'
def sel_inventory(text_widget): inventory = [] ip = dp.InventoryProcessor(database) sql = ip.build_sel_code() for row in ip.execute_sql_code(sql): inventory.append(dm.Inventory(row[0], row[1])) ip.db_con.commit() ip.db_con.close() text_widget['state'] = 'normal' text_widget.delete(1.0, tk.END) if inventory is None: text_widget.insert("No data available") else: text_widget.insert(tk.END, "InventoryID,InventoryDate\n") for row in inventory: print(row, type(row)) text_widget.insert(tk.END, str(row) + "\n") text_widget['state'] = 'disabled'