I made a program to get a value from user and display data in a table equal to the user input, my problem is the data is not updated in the columns and not displayed whatever the data is retrieved and printed, I searched on it and I get nothing
def show_data(self,panel_value):
try:
for item in self.get_children():
self.delete(item)
Current_data = db_file("database.db").get_data(panel_value)
print(Current_data)
self.insert_data(DB_data=Current_data)
self.update()
except Exception as e:
print(f"{e}")
def insert_data(self,DB_data):
for row in DB_data:
self.insert("", "end", values=row)
print("Row inserted:", row)
the database body
'( "Floor_Level" text, "Panel_name" text, "Demand_load" float, "Load_Current" float, "Safety_Factor" float, "CB_Type" text, "CB_Rating" integer, "No_of_cables" integer, "No_of_Cores" text, "Derating_Factor" float, "Incoming_Cable" integer, "Cable type" text, "ECC" text, "Length" float, "VD_PER" float, "Acc_VD" float, "SC_PER" float )
the data sample:
sample1= [('GROUND FLOOR', 'SMDB-1', 65.0, 93.0, 1.0, 'MCCB', 100, 1, '4C', 0.7, 35, 'CU/PVC', '1X16', 120.0, 3.0, 3.0, 3.0), ('FIRST FLOOR', 'SMDB-2', 148.0, 213.0, 1.0, 'MCB', 63, 1, '4C', 0.7, 150, 'CU/PVC', '1X95', 90.0, 2.0, 2.0, 2.0), ('SECOND FLOOR ', 'SMDB-3', 161.0, 232.0, 2.0, 'ACB', 250, 1, '4C', 0.7, 150, 'CU/PVC', '1X95', 85.0, 2.0, 2.0, 2.0)]
sample2= [('sample 2 GROUND FLOOR', 'SMDB-1', 65.0, 93.0, 1.0, 'MCCB', 100, 1, '4C', 0.7, 35, 'CU/PVC', '1X16', 120.0, 3.0, 3.0, 3.0), ('FIRST FLOOR', 'SMDB-2', 148.0, 213.0, 1.0, 'MCB', 63, 1, '4C', 0.7, 150, 'CU/PVC', '1X95', 90.0, 2.0, 2.0, 2.0), ('SECOND FLOOR ', 'SMDB-3', 161.0, 232.0, 2.0, 'ACB', 250, 1, '4C', 0.7, 150, 'CU/PVC', '1X95', 85.0, 2.0, 2.0, 2.0)]