Skip to content

Commit 6d4c263

Browse files
committed
Change execution of main function thread
1 parent 55fa6e1 commit 6d4c263

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.pyw

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import time
44
import pystray
55
from PIL import Image
66
import os
7+
import threading
78

89

910
class Const:
@@ -128,6 +129,7 @@ def main():
128129
sendNotification("Low Battery, Plug-in charger", ("The Power is at " + str(battery.percent)))
129130
time.sleep(config.alertTimeInterval)
130131
config.readConfig()
132+
print('hey')
131133

132134

133135
def showSystemStatus(config: Config):
@@ -139,8 +141,9 @@ def showSystemStatus(config: Config):
139141

140142
if __name__ == "__main__":
141143
try:
144+
mainFunctionThread = threading.Thread(target=main)
145+
mainFunctionThread.start()
142146
setupStray()
143-
main()
144147
except Exception as e:
145148
with open("./error.txt", 'w') as errorFile:
146149
errorFile.write(str(e))

0 commit comments

Comments
 (0)