-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
28 lines (22 loc) · 814 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
#-*- coding:utf-8 -*-
from Translators import baidu, youdao, google
from config import param
import threading
if __name__=='__main__':
from_lan = param['from_lan']
to_lan = param['to_lan']
corpus_file = param['data_file']
bd = baidu.Baidu(from_lan, to_lan, trans_engine='百度', max_bytes_length=3000)
yd = youdao.Youdao(from_lan, to_lan, trans_engine='有道', max_bytes_length=5000)
gg = google.Google(from_lan, to_lan, trans_engine='谷歌', max_bytes_length=2000)
t1 = threading.Thread(target=bd.run, args=())
t2 = threading.Thread(target=yd.run, args=())
t3 = threading.Thread(target=gg.run, args=())
print('翻译启动')
t1.start()
t2.start()
t3.start()
t1.join()
t2.join()
t3.join()
print('翻译完毕')