-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
36 lines (26 loc) · 802 Bytes
/
setup.py
File metadata and controls
36 lines (26 loc) · 802 Bytes
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
31
32
33
34
35
36
from helper import check_bool
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("flps", type=int)
parser.add_argument("epns", type=int)
parser.add_argument("--hold", type=check_bool)
args = parser.parse_args()
if args.hold:
bash_start = ["xterm", "-hold", "-e", "python"]
else:
bash_start = ["xterm", "-e", "python"]
def setup():
bash_icn = bash_start + ["icn.py", str(args.epns)]
bash_flp = bash_start + ["flp.py"]
bash_epn = bash_start + ["epn.py"]
subprocess.Popen(bash_icn)
port = 5557
for _ in range(args.epns):
bash_flp += [str(port)]
subprocess.Popen(bash_epn + [str(port)])
port += 1
for _ in range(args.flps):
subprocess.Popen(bash_flp)
if __name__ == "__main__":
setup()