Jan-17-2023, 07:26 PM
Hi, I'm using python for a short time and I'm getting a little complicated. What I'm looking for is that when I enter the corresponding tab, it displays the data loaded in a json, through the treeview.
I tried adding the json in this way, but it only lists the first object in the list.
![[Image: Captura-de-pantalla-2023-01-17-161954.png]](https://i.ibb.co/5F0nR7v/Captura-de-pantalla-2023-01-17-161954.png)
This is how my json looks.
![[Image: Captura-de-pantalla-2023-01-17-162419.png]](https://i.ibb.co/C0fnrFB/Captura-de-pantalla-2023-01-17-162419.png)
If I try this way, that I saw in another code, nothing appears in the treeview.
I tried adding the json in this way, but it only lists the first object in the list.
f = open('personal.json',) data = json.load(f) count=0 for record in data: json_tree.insert(parent='', index="end", iid=count, text="", values=(record[0], record[1],record[2],record[3],record[4],record[5],record[6],record[7])) count+=1
![[Image: Captura-de-pantalla-2023-01-17-161954.png]](https://i.ibb.co/5F0nR7v/Captura-de-pantalla-2023-01-17-161954.png)
This is how my json looks.
![[Image: Captura-de-pantalla-2023-01-17-162419.png]](https://i.ibb.co/C0fnrFB/Captura-de-pantalla-2023-01-17-162419.png)
If I try this way, that I saw in another code, nothing appears in the treeview.
def insert_data(): with open('personal.json', 'r') as read: wList = json.loads(read.read())['Clientes'] wDict = {} wDict['Clientes'] = wList for weapon in wList: json_tree.insert(parent='', index='end', iid=0, text="", values=(weapon['Logo'],weapon['Nombre'],weapon['Tenant ID'],weapon['Aplication ID'],weapon['Secret ID'],weapon['Token'],weapon['Periocididad'],weapon['Token']))I would be very grateful if someone can exemplify or guide me on what I am doing wrong. Thanks