-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.py
30 lines (24 loc) · 791 Bytes
/
launch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import subprocess
import threading
def launch_program(command):
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Failed to run: {command}. Error: {e}")
if __name__ == "__main__":
# Replace these commands with the actual programs you want to run
commands = [
"python autoFoot.py 1",
"python autoFoot.py 2",
"python autoFoot.py 3",
"python autoFoot.py 4",
]
threads = []
for command in commands:
thread = threading.Thread(target=launch_program, args=(command,))
threads.append(thread)
thread.start()
# Wait for all threads to finish
for thread in threads:
thread.join()
print("All programs have been launched.")