谷歌翻译接口

安装

1
pip install google_trans_new

测试

1
2
3
4
5
from google_trans_new import  google_translator  

translator = google_translator()
translate_text = translator.translate('美国下一届总统将会是谁?',lang_src='zh-cn',lang_tgt='en')
print(translate_text)

默认自动检测语种

效果

1
Who will be the next president of the United States?