file walking in python
<p>So, I've got a working solution, but it's ugly and seems un-idiomatic. The problem is this:</p>

<p>For a directory tree, where every directory is set up to have:</p>

<ul>
<li>1 <code>.xc</code> file</li>
<li>at least 1 <code>.x</code> file</li>
<li>any number of directories which follow the same format</li>
</ul>

<p>and nothing else. I'd like to, given the root path and walk the tree applying <code>xc()</code> to the contents of <code>.xc</code> fies, <code>x</code> to the contents to <code>.x</code> files, and then doing the same thing to child folders' contents.</p>

<p>Actual code with explanation would be appreciated.</p>

<p>Thanks!</p>
