Re: Iterating through a nested list

2006-04-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > for obj in Array: > if isinstance(obj, list): > for item in obj: > print item > else: > print obj I would "reverse" that check and test `obj` for not being a string:: for obj in Array: if not isinstance(ob

Re: Iterating through a nested list

2006-04-15 Thread Steven D'Aprano
On Sat, 15 Apr 2006 22:36:17 -0500, CamelR wrote: > I have a newbie question, and I have seen reference to this mentioned > in many places, but all just say "this has been discussed frequently > in (other places) so we won't discuss it here..." and I am unable to > find the actual answer... > > I

Iterating through a nested list

2006-04-15 Thread CamelR
I have a newbie question, and I have seen reference to this mentioned in many places, but all just say "this has been discussed frequently in (other places) so we won't discuss it here..." and I am unable to find the actual answer... I expected : Array = ["topdir", ["/subdir1", ["/file1", "/file2