-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartAll.py
More file actions
41 lines (32 loc) · 1.21 KB
/
Copy pathstartAll.py
File metadata and controls
41 lines (32 loc) · 1.21 KB
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
37
38
39
40
41
import subprocess
import time
import schedule
def run_command(command, cwd=None):
process = subprocess.Popen(command, cwd=cwd, shell=True)
process.wait()
def csvmaker_process():
# Assuming csvMaker.py is the script to run
run_command("python csvMaker.py")
# Command to install Python dependencies
python_install_command = "pip install -r requirements.txt"
# Install Python dependencies
run_command(python_install_command)
# Commands to install dependencies
frontend_install_command = "npm install"
backend_install_command = "npm install"
# Run npm install in frontend and backend
run_command(frontend_install_command, cwd="frontend")
run_command(backend_install_command, cwd="backend")
# Commands to start the processes
frontend_command = "npm run start"
backend_command = "npm run start"
# Start the processes concurrently
frontend_process = subprocess.Popen(frontend_command, cwd="frontend", shell=True)
backend_process = subprocess.Popen(backend_command, cwd="backend", shell=True)
try:
# Run csvmaker_process once before entering the loop
csvmaker_process()
except KeyboardInterrupt:
# Terminate all processes if the script is interrupted
frontend_process.terminate()
backend_process.terminate()