Re: text-mode tree viewer?

2007-06-26 Thread Martin Skou
Torsten Bronger wrote: > > It doesn't show Paul and Mary on the same level. I (think I) solved > the problem with this: > I could do so if Poul was in a list of his own, like "Arthur" and "Clara". /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: text-mode tree viewer?

2007-06-26 Thread Torsten Bronger
Hallöchen! Martin Skou writes: > Not quite, but almost: > > > data=[["Peter", >["Ian", > [["Randy", > ["Clara"], > "Paul", > ["Mary", >["Arthur"]]] This was flawed, there were two brackets too much: data=[["Peter", ["Ian",

Re: text-mode tree viewer?

2007-06-26 Thread Martin Skou
Not quite, but almost: data=[["Peter", ["Ian", [["Randy", ["Clara"], "Paul", ["Mary", ["Arthur"]]] def show(data,level): for i in data: if i.__class__.__name__=='list': show(i,level

text-mode tree viewer?

2007-06-26 Thread Torsten Bronger
Hallöchen! I'm looking for a package/routine that can convert [["Peter", ["Ian", [["Randy", ["Clara"], "Paul", ["Mary", ["Arthur"]]] into +---> Peter | | | +---> Ian | | | +---> Randy |