Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. def afegirvalors(self, list, currentparent, count):
  2. count += 1
  3. listtype = [type(i) for i in list]
  4. numlist = listtype.count(type([]))
  5. numstr = len(listtype)-numlist
  6. for num in range(numstr-1):
  7. self.tree.insert(currentparent, "end", text=list[num], tag="pll")
  8. if type(list[numstr-1]) == type((1,)):
  9. self.tree.insert(currentparent, "end", text=list[numstr-1][0], tag="def")
  10. else:
  11. self.tree.insert(currentparent, "end", text=list[numstr-1], tag="pll")
  12. if numlist == 0:
  13. return None
  14. else:
  15. listlist = list[-numlist:]
  16. for num in range(numlist):
  17. idparent = "phant"+str(count)+str(num)
  18. self.tree.insert(currentparent, "end", idparent)
  19. afegirvalors(self, list[-numlist:][num], idparent, count)
  20.  
  21. count = 0
  22. afegirvalors(self, listpll, "", count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement