Re: Traversing through Dir()

2010-03-27 Thread Dave Angel
Andrej Mitrovic wrote: On Mar 26, 9:18 am, Alf P. Steinbach al...@start.no wrote: snip 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

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-26 Thread Andrej Mitrovic
On Mar 26, 9:18 am, Alf P. Steinbach al...@start.no 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

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.

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 andrej.mitrov...@gmail.com 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