-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (42 loc) · 1.1 KB
/
main.py
File metadata and controls
56 lines (42 loc) · 1.1 KB
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
# -*- coding: utf-8 -*-
# author: ZSAIm
# github: https://github.com/ZSAIm/TakeTheCourse_GDUT
# programming by python3.5
import threading
import llogger
import time
import sys
import os
import gui
from handler.Pool import UserPool
import captcha.killer
import GUIEventBinder
pool = None
def init_model():
llogger.normal('NULL', '开始加载验证码识别模型。')
try:
captcha.killer.init()
except:
llogger.error('NULL', '识别模型加载失败。')
else:
llogger.ok('NULL', '识别模型加载成功。')
def init_dir():
if not os.path.exists('logs') or os.path.isfile('logs'):
os.mkdir('logs')
if not os.path.exists('cookies') or os.path.isfile('cookies'):
os.mkdir('cookies')
def __main__():
global pool
init_dir()
init_model()
pool = UserPool()
GUIEventBinder.init(pool)
def main():
threading.Thread(target=__main__).start()
if __name__ == '__main__':
gui.init()
main()
gui.MainLoop()
llogger.export('logs/%s.log' % time.asctime(time.localtime()).replace(':', '-'))
pool.exit()
sys.exit()