資源簡介
python英漢詞典,在線翻譯器,帶GUI界面,支持自定義單詞搜索
代碼片段和文件信息
‘‘‘
mission?=?樂詞典在線翻譯,有道詞典內核
date?=?2018?02?01?0:25
author?=?HanLe
‘‘‘
import?requests
import?easygui
def?translate(content):
????url?=?‘http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=null‘
????headers?=?{
????????‘User-Agent‘:?‘Mozilla/5.0?(Windows?NT?10.0;?Win64;?x64)?AppleWebKit/537.36?(KHTML?like?Gecko)?Chrome/63.0.3239.132?Safari/537.36‘}
????data?=?{
????????‘i‘:?content
????????‘from‘:?‘AUTO‘
????????‘to‘:?‘AUTO‘
????????‘smartresult‘:?‘dict‘
????????‘client‘:?‘fanyideskweb‘
????????‘salt‘:?‘1517413113813‘
????????‘sign‘:?‘9c32e8d96b8c9a3693c9730ea98b0dc9‘
????????‘doctype‘:?‘json‘
????????‘version‘:?‘2.1‘
????????‘keyfrom‘:?‘fanyi.web‘
????????‘action‘:?‘FY_BY_CL
評論
共有 條評論