资源简介
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
评论
共有 条评论