Advertisement
wilduk

nikoś.py

Dec 21st, 2022
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import sys
  2. import cv2  # OpenCV
  3. from anytree.dotexport import RenderTreeGraph
  4. from anytree.importer import DictImporter
  5. importer = DictImporter()
  6.  
  7. def show(self) -> None:
  8.         data = self.root.to_dict()
  9.         tree_root = importer.import_(data)
  10.         RenderTreeGraph(tree_root).to_picture("tree.png")
  11.         img = cv2.imread("tree.png", cv2.IMREAD_ANYCOLOR)
  12.         cv2.imshow("tree", img)
  13.         cv2.waitKey(0)
  14.         sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement