Skip to content

How to extract data as dict from tree widget? #5224

Closed Answered by TomJGooding
YoonSungHyun-Git asked this question in Q&A
Discussion options

You must be logged in to vote

Perhaps rather than traversing the entire tree, you could utilise the TreeNode.data?

Based on your example, you could create the tree something like this.

for key, value in example_data.items():
    tree.root.add_leaf(
	label=f"{key}={value}",
	data={key: value},

Then after the node value has been updated:

example_data.update(node.data)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@YoonSungHyun-Git
Comment options

@YoonSungHyun-Git
Comment options

@TomJGooding
Comment options

Answer selected by YoonSungHyun-Git
@YoonSungHyun-Git
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants