from CommandRunner import CommandRunnerDebug as Runner import importlib import os print("Loading modules") modules = {} for folder in os.listdir("./modules"): try: curr_module = importlib.import_module('.' + folder, package="modules") modules[folder] = curr_module.get_module() except AttributeError: pass print("Modules loaded successfully.\n") print("Available Modules:") for mod in modules.keys(): print(mod) print() while True: chosen_module = input("Please specify your module: ") if chosen_module in modules.keys(): break else: print("Module was not found.") print("\nChosen Module to run: " + chosen_module) Runner().run(modules[chosen_module])