Stampare albero parole python
Inviato: sab 22 nov 2014, 11:50
Salve ragazzi ho creato un albero di parole inizialmente vuoto in questo modo:
class WNode(object):
def __init__(self, w):
self._w = w
self._children = []
self._level = 0
def add_children(self, w):
self._children.append(w)
Sapete dirmi come posso stampare questo albero e non far apparire la scritta <__main__.WNode at 0x57992f0>
Grazie
class WNode(object):
def __init__(self, w):
self._w = w
self._children = []
self._level = 0
def add_children(self, w):
self._children.append(w)
Sapete dirmi come posso stampare questo albero e non far apparire la scritta <__main__.WNode at 0x57992f0>
Grazie