需要使用 百度翻译开放平台通用文本翻译API
https://fanyi-api.baidu.com/product/11
标准版(免费使用)5万字符/月
高级版(免费使用,需要实名认证)100万字符/月
确保你已经通过某种方式安装了requests
和pyperclip
库(例如pip install requests pyperclip
)
然后在开发者信息界面 https://fanyi-api.baidu.com/manage/developer 获取对应的APP ID
和密钥
,分别填入变量appid
和secretKey
中即可