have you tried os.walk() ?<br><br><div class="gmail_quote">On Fri, Mar 26, 2010 at 5:55 AM, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I would like to traverse through the entire structure of dir(), and<br>
write it to a file.<br>
<br>
Now, if I try to write the contents of dir() to a file (via pickle), I<br>
only get the top layer. So even if there are lists within the returned<br>
list from dir(), they get written as a list of strings to the file.<br>
<br>
Basically, I have an embedded and somewhat stripped version of Python.<br>
I would like to find out just how much functionality it has (I have no<br>
documentation for it), so I thought the best way to do that is<br>
traverse thru the dir() call. Any clues as to how I could write the<br>
whole structure to a file? I guess I'll need some kind of recursion<br>
here. :)<br>
<font color="#888888"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>