How to check if folder is empty with Python? : <p>I am trying to check if a folder is empty and do the following:</p>

<pre><code>import os
downloadsFolder = '../../Downloads/'
if not os.listdir(downloadsFolder):
    print "empty"
else:
    print "not empty"
</code></pre>

<p>Unfortunately, I always get "not empty" no matter if I have any files in that folder or not. Is it because there might be some hidden system files? Is there a way to modify the above code to check just for not hidden files?</p>
