資源簡介
Python調用百度翻譯接口
代碼片段和文件信息
#?/usr/bin/env?python
#?-*-?coding:?utf-8?-*-
import?requests
import?random
import?hashlib
q?=?‘蘋果‘
salt?=?str(random.randint(050))
#申請網站?http://api.fanyi.baidu.com/api/trans
appid?=?‘‘
secretKey?=?‘‘
sign?=?appid+q+salt+secretKey
#?sign=sign.encode(“utf-8“)
#?m?=?hashlib.md5()
#?m.update(sign)
#?sign?=?m.hexdigest()
#轉換為MD5
s
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????709??2019-07-09?12:00??百度翻譯接口.py
-----------?---------??----------?-----??----
??????????????????709????????????????????1
- 上一篇:pyglet源碼+文檔
- 下一篇:OpenCV官方文檔教程(基于python)
評論
共有 條評論