79199544

Date: 2024-11-18 10:29:25
Score: 1
Natty:
Report link

what about:

 def module_is_available(the_path,module_folder_name):    
    return module_folder_name in os.listdir(the_path)

or if you want to check all paths currently in sys.path:

def module_is_available_in_sys_path(module_folder_name):        
    for p in sys.path:
        if module_is_available(p,module_folder_name)
            return True
    return False
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): what
  • Low reputation (1):
Posted by: 3d Illusions