import subprocess import sys def send_fw(firmware, ids): for id in ids: subprocess.call(['python', 'send_fw.py', firmware, str(id)]) if __name__ == "__main__": firmware = sys.argv[1] ids = sys.argv[2].split(';') # Split the ID string into a list send_fw(firmware, ids)