Re: Traversing through Dir()

2010-03-27 Thread Dave Angel
Andrej Mitrovic wrote: On Mar 26, 9:18 am, "Alf P. Steinbach" wrote: hierarchy =nspect.getclasstree( classes ) # 'hierarchy' is a list array of tuples and nested list arrays of the same form. # The top level is an array of two items, the first item a tuple describing the 'object' # class,

Re: Traversing through Dir()

2010-03-26 Thread Andrej Mitrovic
On Mar 26, 9:18 am, "Alf P. Steinbach" wrote: > * Andrej Mitrovic: > > > I would like to traverse through the entire structure of dir(), and > > write it to a file. > > > Now, if I try to write the contents of dir() to a file (via pickle), I > > only get the top layer. So even if there are lists w

Re: Traversing through Dir()

2010-03-26 Thread Alf P. Steinbach
* Andrej Mitrovic: I would like to traverse through the entire structure of dir(), and write it to a file. Now, if I try to write the contents of dir() to a file (via pickle), I only get the top layer. So even if there are lists within the returned list from dir(), they get written as a list of

Re: Traversing through Dir()

2010-03-25 Thread Shashwat Anand
have you tried os.walk() ? On Fri, Mar 26, 2010 at 5:55 AM, Andrej Mitrovic wrote: > I would like to traverse through the entire structure of dir(), and > write it to a file. > > Now, if I try to write the contents of dir() to a file (via pickle), I > only get the top layer. So even if there are

Traversing through Dir()

2010-03-25 Thread Andrej Mitrovic
I would like to traverse through the entire structure of dir(), and write it to a file. Now, if I try to write the contents of dir() to a file (via pickle), I only get the top layer. So even if there are lists within the returned list from dir(), they get written as a list of strings to the file.