TA的每日心情 | 无聊 2018-12-4 08:17 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
发表于 2019-3-28 12:15:27
|
显示全部楼层
我用它翻英语没毛病,但如果翻其他语种如德语、日语就会错误。代码如下1 Y& g$ }" b2 v- m2 a
5 T* A" c6 E: L/ ~查询错误:程序返回,退出代码为 1. Traceback (most recent call last): File "D:\PathTo\translate.py", line 27, in <module> gg_trans = translator.translate(sys.argv[1], dest='zh-cn').text File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\googletrans\client.py", line 132, in translate data = self._translate(text, dest, src) File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\googletrans\client.py", line 57, in _translate token = self.token_acquirer.do(text) File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\googletrans\gtoken.py", line 180, in do self._update() File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\googletrans\gtoken.py", line 59, in _update code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group' |
|