-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
34 lines (28 loc) · 777 Bytes
/
main.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
from group import Group
import sys
import os
def lowpriority():
""" Set the priority of the process to below-normal."""
try:
sys.getwindowsversion()
except AttributeError:
isWindows = False
else:
isWindows = True
if isWindows:
import win32api,win32process,win32con
pid = win32api.GetCurrentProcessId()
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
win32process.SetPriorityClass(handle, win32process.BELOW_NORMAL_PRIORITY_CLASS)
else:
os.nice(19)
def main():
if len(sys.argv) != 2:
print("Error. Write data directory")
return
lowpriority()
os.chdir(sys.argv[1])
app = Group()
app.run()
if __name__ == "__main__":
main()