Closed yanite closed 10 years ago
I can't locate the error with only this info. Please give a piece of your code slice, or you run the examples such family_tree.py and notify me about the output.
Simply, after installing treelib (original pyTree), just add import with
from treelib import Tree, Node
Good luck,
Jamin
yes , thank you , from treelib import Tree, Node # is right from pyTree.Tree import Tree # is error ok
Yeah, sorry for the name confusing. pyTree is not the library name, and treelib actually is. I changed the name from pyTree to treelib as there was conflict on PyPi to publish this tool. Please use the first import for this library merely. Enjoy, Jamin
from pyTree.Tree import Tree
----> 1 t = Tree()
F:\winpython27\python-2.7.5.amd64\Lib\site-packages\pyTree\Tree.pyc in init(self, data, children) 22 @param children: sub node(s) of Tree, could be None, child (single) or children (multiple) 23 ''' ---> 24 self.data = data 25 self.children = [] 26 self.parent=None #private parent attribute
F:\winpython27\python-2.7.5.amd64\Lib\site-packages\pyTree\Tree.pyc in setattr(self, name, value) 54 raise AttributeError("To add children, please use addChild or addChildren method.") 55 else: ---> 56 super().setattr(name, value) 57 58 def str(self, _args, *_kwargs):
TypeError: super() takes at least 1 argument (0 given)
what?