You should consider refactoring the *.py finding logic out into a separate method. You could even make it a generator.