import json import subprocess from AbstractModule import AbstractModule class CmdToolsModule(AbstractModule): def run(self): print("Try to install basic Command-line tools") with open("modules/command-line tools/programs.json") as config_file: programms_list = json.load(config_file) out = subprocess.run(["apt", "install"] + programms_list, shell=True, capture_output=True) if len(out.stderr) > 0: print(out.stderr.decode()) print("Install might be not complete, please check output above.") else: print("Installed successful.")