def walkdir(dir):
 GLOB_PATTERN = os.path.join(dir, '*.[p][y]*')
 pathlist = glob.glob(GLOB_PATTERN)
 filterlist = [x for x in pathlist if (x.endswith('.py') or x.endswith('.pyw'))]
 if (filterlist != []):
  return filterlist
 else:
  return None

def walkdir ( dir ) : GLOB_PATTERN = os . path . join ( dir , '*.[p][y]*' ) pathlist = glob . glob ( GLOB_PATTERN ) filterlist = [ x for x in pathlist if ( x . endswith ( '.py' ) or x . endswith ( '.pyw' ) ) ] if ( filterlist != [ ] ) : return filterlist else : return None
return a list of .