摘要: 1 import hashlib 2 ybq_pwd='bugaosuni' 3 m=hashlib.md5() 4 bytes_ybq=ybq_pwd.encode()#把字符串转成bytes类型,中文字符在Python中是以unicode存在的,我们在进行hash前必须把数据转换成bytes类型 5 m.update(bytes_ybq)#加密,不能字符串,只能传byte类型,二进... 阅读全文
posted @ 2018-01-16 23:00 飞鸟与新月 阅读(669) 评论(0) 推荐(0) 编辑
摘要: import time time.sleep(2)#等待几秒 时间的三种表现方式: 1.格式化好的时间 2018-1-14 16:12 2.时间戳 是从unix元年到现在所有的秒数 3.时间元组 想时间戳和格式化好的时间相互转换的话,都有先转成时间元组,然后才能转】 datetime模块: 阅读全文
posted @ 2018-01-16 21:41 飞鸟与新月 阅读(716) 评论(0) 推荐(0) 编辑
摘要: 1 import random,string 2 print(random.randint(1,199))#1-199随机取一个整数,包含199 3 print(string.digits)#所有的数字0-9 4 print(string.ascii_lowercase)#所有的小写字母 5 print(string.ascii_uppercase)#所有的大写字母 6 print... 阅读全文
posted @ 2018-01-16 00:04 飞鸟与新月 阅读(701) 评论(0) 推荐(0) 编辑