I am trying to put some data in my treeview and I'm new to the treeview and do'sent understand it fully, if tried to read the documentation, but got even more confused.
I created a nested list with 2 sublists and last some dictionaries.
isolering = [
[
{"name": "mineraluld"},
{"dim": "0,195"},
{"lambda": "0,37"},
{"z": "250"},
{"fire": "NA"}
],
[
{"name": "mineraluld2"},
{"dim": "0,195"},
{"lambda": "0,37"},
{"z": "250"},
{"fire": "NA"}
]]
materialLibrary = [isolering]
Now i can't figure out the proper way to put my data in the treeview.
This is how far I got.
I can't figure out, the way to call my data. I trying to it, like you would call it by it's index. But I understand it's wrong.
tree.insert("" , 0, text="Name")
tree.insert("", 1, "dirIso", text="Isolering")
tree.insert("dirIso", 1, text=materialLibrary[0][1][0]["name"],values=(materialLibrary[0][1][0]["dim"],
materialLibrary[0][1][0]["lambda"],
materialLibrary[0][1][0]["z"],
materialLibrary[0][1][0]["fire"]))
I have here a picture of hat I'm trying to accomplish.
The error message I receive is this: KeyError: 'dim'
Any help is appreciated or point in the right direction.
Thx
See Question&Answers more detail:
os