Distinguishing Files From Directories
<p>So I'm sure this is a stupid question, but I've looked through Python's documentation and attempted a couple of Google codes and none of them has worked.</p>

<p>It seems like the following should work, but it returns "False" for 
In my directory /foo/bar I have 3 items: 1 Folder "[Folder]", 1 file "test" (no extension), and 1 file "test.py".</p>

<p>I'm look to have a script that can distinguish folders from files for a bunch of functions, but I can't figure out anything that works.</p>

<pre><code>#!/usr/bin/python
import os, re
for f in os.listdir('/foo/bar'):
    print f, os.path.isdir(f)
</code></pre>

<p>Currently returns false for everything.</p>
