摘要: 查看天气import requestsresponse = requests.get("http://www.weather.com.cn/adat/sk/101010500.html")response.encoding = "utf-8"result = response.textprint(r 阅读全文
posted @ 2018-07-25 20:15 黄瓜不是好瓜 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 最简单的MD5 import hashlib # ######## md5 ######## hash = hashlib.md5() # help(hash.update) hash.update(bytes('admin', encoding='utf-8')) print(hash.hexdi 阅读全文
posted @ 2018-07-25 11:22 黄瓜不是好瓜 阅读(409) 评论(0) 推荐(0) 编辑
摘要: % 格式 tpl = "i am %s" % "alex" tpl = "i am %s age %d" % ("alex", 18) tpl = "i am %(name)s age %(age)d" % {"name": "alex", "age": 18} tpl  阅读全文
posted @ 2018-07-25 11:21 黄瓜不是好瓜 阅读(140) 评论(0) 推荐(0) 编辑
摘要: import hashlib def md5(arg): ooo = hashlib.md5(bytes('qazwsx',encoding='utf-8')) ooo.update(bytes('arg',encoding='utf-8')) return ooo.hexdigest() def 阅读全文
posted @ 2018-07-25 10:32 黄瓜不是好瓜 阅读(463) 评论(0) 推荐(0) 编辑