First of all Im out of practice and Im trying to create a tree structure in Python 3.8 to feed my QTreeView.
I read the output of zfs (subprocess.check_output) and split the whole stuff to have a list with pool names:
Example list:
pools = ['deadpool','deadpool/Backup','deadpool/Photos','deadpool/Photos/Foobar']
Now I've to convert and sort the whole list by parent/child and it should look like this at the end so I can use it in a QTreeView:
{'deadpool':
{
'Backup': {},
'Photos': {'Foobar': {}},
}
}
I tried it with two for loops but Im just too stupid..
Can someone show me an easy example?
Or is there an easier way in QtTreeView/QTreeWidget itself?