-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
55 lines (35 loc) · 918 Bytes
/
start.py
File metadata and controls
55 lines (35 loc) · 918 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
New's Search Engine
Created on Wes Jun 11, 2020
@author: Liwei Wang
"""
"""
New's Scrapy Crawler
Created on Wes Aug 8, 2018
Last Modified on June 22, 2020
@author: Liwei Wang
"""
import os
import multiprocessing
import threading
def p0():
os.system("python Backend/get_data.py&")
def p1():
os.system("python Backend/api.py&")
def p2():
os.system("serve -s build&")
def p3():
os.system("cd Backend/News_Crawler/News_Crawler && "
"scrapy crawl News_Crawler&")
if __name__ == "__main__":
# multiprocessing -- python start.py/ & !!!!!!!!!!!!!!
pro0 = multiprocessing.Process(target=p0)
pro1 = multiprocessing.Process(target=p1)
pro2 = multiprocessing.Process(target=p2)
pro3 = multiprocessing.Process(target=p3)
pro0.start()
pro1.start()
pro2.start()
pro3.start()
#pro1 = threading.Thread(target=p1)
#pro2 = threading.Thread(target=p2)