烦恼
sky-影
这个作者很懒,什么都没留下…
展开
-
python hash运用
#算具体的哈希值 import hashlib ##网页的哈希值计算 # md5=hashlib.md5() # md5.update('http://www.baidu.com'.encode("utf-8")) # print(md5) # print(md5.hexdigest()) # 数据去重 哈希过程 #文件的哈希值计算 for file in ["ddd.txt","dd.tx...原创 2019-12-27 20:27:49 · 176 阅读 · 0 评论 -
python批量翻译各种备注信息
(1)小强版 import http.client import hashlib import urllib import random import json def etoc(text): appid = '' # 填写你的appid secretKey = '' # 填写你的密钥 myurl = '/api/trans/vip/translate' ...原创 2019-12-26 14:35:34 · 206 阅读 · 0 评论 -
python 的 yield
(1)简单输出 用next、send def foo(): while True: s = yield 23 print("res",s) g = foo() print(next(g)) print(g.send(45)) print(next(g)) >>23 >>res 45 >>23 >>res None >>2...原创 2019-12-26 14:25:14 · 76 阅读 · 0 评论