def list_profiles_in(path):
 files = os.listdir(path)
 profiles = []
 for f in files:
  try:
   full_path = os.path.join(path, f)
  except UnicodeError:
   continue
  if (os.path.isdir(full_path) and f.startswith('profile_')):
   profiles.append(f.split('_', 1)[(-1)])
 return profiles

def list_profiles_in ( path ) : files = os . listdir ( path ) profiles = [ ] for f in files : try : full_path = os . path . join ( path , f ) except UnicodeError : continue if ( os . path . isdir ( full_path ) and f . startswith ( 'profile_' ) ) : profiles . append ( f . split ( '_' , 1 ) [ ( - 1 ) ] ) return profiles
list profiles in a given root directory .