Use the flake8 tool - this is a wrapper around pyflakes , pep8 and mccabe .
Among other functions, it has the --exclude option:
--exclude=patterns exclude files or directories which match these comma separated patterns (default: .svn,CVS,.bzr,.hg,.git,__pycache__)
source share