<div dir="ltr"><div><div><div><a href="http://docs.python.org/2/library/os.html">http://docs.python.org/2/library/os.html</a><br><dl class=""><dt id="os.walk">
<tt class="">os.</tt><tt class="">walk</tt><big>(</big><em>top</em>, <em>topdown=True</em>, <em>onerror=None</em>, <em>followlinks=False</em>) :::</dt></dl><p id="index-20">"Generate the file names in a directory tree by walking the tree
either top-down or bottom-up. For each directory in the tree rooted at directory
<em>top</em> (including <em>top</em> itself), it yields a 3-tuple <tt class=""><span class="">(dirpath,</span> <span class="">dirnames,</span>
<span class=""><b>filenames</b>)</span></tt>.</p>
<em>dirpath</em> is a string, the path to the directory.  <em>dirnames</em> is a list of the
names of the subdirectories in <em>dirpath</em> (excluding <tt class=""><span class="">'.'</span></tt> and <tt class=""><span class="">'..'</span></tt>).
<em>filenames</em> is a list of the names of the non-directory files in <em>dirpath</em>.
Note that the names in the lists contain no path components.  To get a full path
(which begins with <em>top</em>) to a file or directory in <em>dirpath</em>, do
<tt class=""><span class="">os.path.join(dirpath,</span> <span class=""><b>name</b>)"<br><br></span></tt></div><tt class=""><span class="">Small revision: Variables does not match.<br><br></span></tt></div><tt class=""><span class="">//Roy Nard<br>

</span></tt></div><tt class=""><span class="">Chalmers<br></span></tt></div>