K A*_*ish 4 python googletrans
尝试使用googletrans检测 Python 中的语言代码。但它会生成错误(有关信息,请参阅错误块)。
\n需要相同的解决方案
\n代码 :
\nimport googletrans\nfrom googletrans import Translator\ntranslator = Translator()\nresult = translator.translate('Mit\xc3\xa4 sin\xc3\xa4 teet')\nprint(result.src)\nprint(result.dest)\nprint(result.origin)\nprint(result.text)\nprint(result.pronunciation)\nRun Code Online (Sandbox Code Playgroud)\n错误:
\n\nC:\\ProgramData\\Anaconda3\\lib\\site-packages\\googletrans\\gtoken.py in _update(self)\n 60 \n 61 # this will be the same as python code after stripping out a reserved word 'var'\n---> 62 code = self.RE_TKK.search(r.text).group(1).replace('var ', '')\n 63 # unescape special ascii characters such like a \\x3d(=)\n 64 code = code.encode().decode('unicode-escape')\n\nAttributeError: 'NoneType' object has no attribute 'group'\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
4114 次 |
| 最近记录: |