Matching filenames with list using a loop ignoring already "processed" files
<p>What I want to do is match a set of files and sort out the ones I want (matching the extention) ignoring other I've already processed using a list</p>

<p>What I've come up with so far is</p>

<pre><code>mylist = []
extensions = ['*.txt', '*.foo', '*.bar']
for dirpath, dirnames, filenames in os.walk(directory):
    skip = None
    for ext in extensions:
        for filename in fnmatch.filter(filenames, ext):
            for test in mylist:
                if test == filename:
                    skip = True
            if not skip:
                ## do my thing
                mylist.append(filename)
</code></pre>

<p>But its ignoring my if test statement. Am I going blind?</p>
