摘要: from hashlib import md5 def encrypt_md5(s): # 创建md5对象 new_md5 = md5() # 这里必须用encode()函数对字符串进行编码,不然会报 TypeError: Unicode-objects must be encoded before 阅读全文
posted @ 2018-09-19 17:06 寒爵 阅读(7350) 评论(0) 推荐(0) 编辑
摘要: 输出结果: 阅读全文
posted @ 2018-09-19 16:43 寒爵 阅读(7313) 评论(0) 推荐(1) 编辑
摘要: 一、校验数字 1、数字:^[0-9]*$ 2、n位的数字:^\d{n}$ 3、至少n位的数字:^\d{n,}$ 4、m-n位的数字:^\d{m,n}$ 5、带1-2位小数的正数或负数:^(-)?\d+(\.\d{1,2})?$ 6、正数、负数或小数:^(-)?\d+(\.\d+)?$ 7、有两位小数 阅读全文
posted @ 2018-09-19 15:04 寒爵 阅读(240) 评论(0) 推荐(0) 编辑