def get_mod_names(filename):
 directory = filename
 if file_exists(filename):
  directory = get_directory_name(filename)
 else:
  raise Exception(('%s does not exist!' % str(filename)))
 ret_val = [x.rsplit('.py')[0] for x in os.listdir(directory) if ((x.endswith('.py') or ('.' not in x)) and (x.lower() != '__init__.py'))]
 return ret_val

def get_mod_names ( filename ) : directory = filename if file_exists ( filename ) : directory = get_directory_name ( filename ) else : raise Exception ( ( '%s does not exist!' % str ( filename ) ) ) ret_val = [ x . rsplit ( '.py' ) [ 0 ] for x in os . listdir ( directory ) if ( ( x . endswith ( '.py' ) or ( '.' not in x ) ) and ( x . lower ( ) != '__init__.py' ) ) ] return ret_val
returns a list of all python modules and subpackages in the same location as filename w/o their " .