随笔分类 - 练习代码
摘要:def triangles(num): L2 = [1, 1] if num >= 1: L1=1 yield L1 if num >= 2: L = [1, 1] yield L if num >= 3: for i in range(num-2): L3 = [L2[i]+L2[i+1] for
阅读全文
摘要:def consumer(): r = '' while True: n = yield r if not n: return print('[CONSUMER] Consuming %s...' % n) r = '200 OK'def produce(c): c.send(None) n = 0
阅读全文
摘要:# -*- coding: utf-8 -*-"""Created on Sat Jun 30 10:56:19 2018@author: lewisliu"""from flask import Flaskfrom flask import requestimport sqlite3import
阅读全文
摘要:import hashlibimport pickle, osimport hmac, randomimport sqlite3def hmac_sha1(key, s): return hmac.new(key.encode('utf-8'), s.encode('utf-8'), 'MD5').
阅读全文
摘要:import hashlibimport pickle, osimport hmac, randomdef hmac_sha1(key, s): return hmac.new(key.encode('utf-8'), s.encode('utf-8'), 'MD5').hexdigest()# 获
阅读全文
摘要:from email import encodersfrom email.header import Headerfrom email.mime.text import MIMETextfrom email.utils import parseaddr, formataddrfrom email.m
阅读全文

浙公网安备 33010602011771号