-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.py
25 lines (23 loc) · 928 Bytes
/
master.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
# Master file to run everything
import os
import sys
while True:
# TO run the server with port number
print("Hit 'Ctrl+C' to get menu to quit & Restart the server.")
print("################################################################################\n################################################################################\n################################################################################\n\n")
print("Starting the server ...")
# cmd = '''gnome-terminal -e "zsh -c \"python3 httpServer.py 5561; exec zsh\""'''
# os.system(cmd)
os.system(f'python3 httpServer.py {sys.argv[1]}')
while True:
print("q for quit\nr for restart.")
key = input()
if key=='q':
exit()
elif key=='r':
print("restarting the server ...")
break
else:
print("invalid input\n")
continue
exit()