-
Notifications
You must be signed in to change notification settings - Fork 3
/
Start.py
65 lines (50 loc) · 1.43 KB
/
Start.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
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
###
# Author: Stefan Holstein
# Timer for the Virtual PythonBarCamp Cologne 2020
#
# Sorry for mixing english & german notes
#
# Todo: print() in logging() ausgabe aendern
###
import sys
import os
sys.path.append(os.path.dirname(__file__))
print(os.path.dirname(__file__))
from threading import Thread, Event
try:
from PyQt5.QtWidgets import QApplication, QFrame
from PyQt5.QtGui import QIcon
used_Qt_Version = 5
except:
try:
from PyQt4.QtGui import QApplication
used_Qt_Version = 4
except:
exit()
pass
def compile_my_GUI():
if used_Qt_Version == 4:
print("Compile QUI for Qt Version: " + str(used_Qt_Version))
os.system("pyuic4 -o Timer_Window.py Timer_Window.ui")
elif used_Qt_Version == 5:
print("Compile QUI for Qt Version: " + str(used_Qt_Version))
os.system("pyuic5 -o Timer_Window.py Timer_Window.ui")
# compile_my_GUI()
from Timer import mainclass
if __name__ == "__main__":
app = QApplication(sys.argv)
# app.setStyle('Fusion')
autoupdate = Event()
my_gauge = mainclass(None, autoupdate)
my_gauge.setWindowTitle("Timer")
icon_name = "icon.png"
icon_path = os.path.dirname(__file__) + os.path.sep + icon_name
app_icon = QIcon()
app_icon.addFile(icon_path)
my_gauge.setWindowIcon(app_icon)
# my_gauge.se
my_gauge.show()
autoupdate.set()
sys.exit(app.exec_())
pass