文档:https://py-googletrans.readthedocs.io/en/latest/
安装
pip install googletrans==4.0.0-rc1
使用
from googletrans import Translator
# 设置Google翻译服务地址
translator = Translator(service_urls=[
'translate.google.cn'
])
translation = translator.translate('hello world', dest='zh-CN')
print(translation.text)