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
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",
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
Hallöchen!
I'm looking for a package/routine that can convert
[["Peter",
["Ian",
[["Randy",
["Clara"],
"Paul",
["Mary",
["Arthur"]]]
into
+---> Peter
| |
| +---> Ian
| |
| +---> Randy
|