String compare question

Robert Dailey rcdailey at gmail.com
Mon Feb 25 11:36:25 EST 2008


Hi,

Currently I have the following code:


ignored_dirs = (
    r".\boost\include"
    )

if __name__ == "__main__":
    # Walk the directory tree rooted at 'source'
    for root, dirs, files in os.walk( source ):
        if root not in ignored_dirs:
            CopyFiles( root, files, ".dll" )
        else:
            print root


Specifically take a look at the if condition checking if a string is inside
of ignored_dirs. Of course this will only do substring searches, however I
want to perform an exact match on this string. Is there anyway of doing
this? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080225/91542cda/attachment.html>


More information about the Python-list mailing list