Python script errors out
<p>I have this script, which I have no doubt is flawed:</p>

<pre><code>import fnmatch, os, sys
def findit (rootdir, find, pattern):
    for folder, dirs, files in os.walk(rootdir):
        print (folder)
    for filename in fnmatch.filter(files,pattern):          
        with open(filename) as f:
            s = f.read()
            f.close()
            if find in s :                  
                print(filename)

findit(sys.argv[1], sys.argv[2], sys.argv[3])
</code></pre>

<p>when I run it I get <code>Errno2, no such file or directory</code>. BUT the file exists. For instance if I execute it by going: <code>findit.py c:\python "folder" *.py</code> it will work just fine, listing all the *.py files which contain the word "folder". BUT if I go <code>findit.py c:\php\projects1 "include" *.php</code></p>

<p>as an example I get <code>[Errno2] no such file or directory: 'About.php'</code> (for example). But About.php exists. I don't understand what it's doing, or what I'm doing wrong.</p>
