-
Notifications
You must be signed in to change notification settings - Fork 9
/
gui.py
executable file
·57 lines (45 loc) · 1.45 KB
/
gui.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/python3.6
import sys,os,shutil
import time
import threading
# import PyQt5
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QImage, QPalette, QBrush
from PyQt5.QtCore import QSize
class TrafficUi(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
naming = "no file selected"
self.setMinimumSize(QSize(800, 481))
self.setWindowTitle("Traffic Management")
centralWidget = QWidget(self)
self.setCentralWidget(centralWidget)
oImage = QImage("ewe.png")
sImage = oImage.scaled(QSize(1300,481))
palette = QPalette()
palette.setBrush(10, QBrush(sImage))
self.setPalette(palette)
run_btn = QPushButton('RUN',self)
run_btn.resize(100,40)
run_btn.move(10,200)
t2 = threading.Thread(target=self.ssd)
t2.start()
time.sleep(5)
run_btn.clicked.connect(self.runMethod)
def gui(self):
#time.sleep(10)
os.system('python work2.py')
def ssd(self):
os.system('python ssd_script.py')
def runMethod(self):
t1 = threading.Thread(target=self.gui)
t1.start()
# t2 = threading.Thread(target=self.ssd)
# t2.start()
return
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
mainwin = TrafficUi()
mainwin.show()
sys.exit(app.exec_())