import subprocess, json, sys, os, threading with open("./nodez.json", "r") as f: nodes = json.loads(f.read()) def run(tgt): #os.system(f"ssh {tgt['u']}@{tgt['fqdn']} sudo apt install -y python3-pillow") os.system(f"ssh {tgt['u']}@{tgt['fqdn']} \"cd ~/repos/openbased/ && python3 c.py\"") for node in nodes.values(): threading.Thread(target=run, args=(node,)).start()