Python17个常用内置模块总结 1、getpass 2、os 3、sys 4、subprocess 5、hashlib 6、json 7、pickle 8、shutil 9、time 10、datetime 11、re 12、random 13、configparser 14、traceback ...
分类:
编程语言 时间:
2019-11-22 01:07:51
阅读次数:
103
一、md5加密 import hashlib #md5加密 h = 'xmb' m = hashlib.md5(h.encode()) result = m.hexdigest() #获取加密后的结果 print(result) #加盐 y = 'abc' password = input('pas ...
分类:
编程语言 时间:
2019-11-19 12:07:27
阅读次数:
62
ThreadPool: Futures: 重构 (在线程池运行时向里面添加新任务) ...
分类:
编程语言 时间:
2019-11-19 12:03:41
阅读次数:
62
介绍Python中的几种常用模块 1.time模块 与时间处理有关的python内置模块 时间戳:自1970-01-01 00.00:00到当前时间,按秒计算,到现在为止一共多少秒 import time # 导入时间模块包import timeprint(time.time()) # 获取当前时间 ...
分类:
编程语言 时间:
2019-11-17 23:42:16
阅读次数:
110
hashlib hashlib是一个加密模块,提供了常见的 摘要算法 ,如MD5,SHA1 MD5算法加密 , 检验数据完整性 所谓摘要算法,也可以称为:哈希算法,离散算法。即通过一个函数,将任意长度的数据转化为一个长度固定的数据串(通常16进制) 摘要算法: ? 摘要一样,内容就一定一样:保证唯一 ...
分类:
其他好文 时间:
2019-11-16 21:36:48
阅读次数:
76
time模块 文件命名规范:不可以以模块名直接对文件命名 例如:time.py 在python中的三种表现形式: 1.时间戳:给电脑看的 2.格式化时间(Format String)给人看到 返回的是时间的字符串 2002 01 11 3. 格式化时间对象(struct_time) ? 返回的是一个 ...
分类:
其他好文 时间:
2019-11-16 19:24:29
阅读次数:
70
time模块 datetime模块 random模块 os模块(与操作系统交互) sys模块(与python解释器交互) hashlib模块 ...
分类:
编程语言 时间:
2019-11-16 17:45:34
阅读次数:
75
用于给文档加密 1 # Author:CallMeV 2 # DATE :2019-11-10 3 # Time : 18:24 4 5 import hashlib 6 7 m = hashlib.md5() 8 print(m) 9 10 m.update('我喜欢你'.encode('utf8 ...
分类:
其他好文 时间:
2019-11-10 19:21:11
阅读次数:
231
后台的login功能实现 from rest_framework.views import APIView from rest_framework.response import Response from django.core.cache import cache from app01 impo ...
分类:
微信 时间:
2019-11-09 17:43:54
阅读次数:
100
(1)进行接口测试的时候,写好接口测试用例,然后模拟请求的时候,会出现请求头鉴权。给你了key值那么可以 import hashlibimport timeimport base64def get_sha1(str_data): sha1_str = hashlib.sha1(str(str_dat ...
分类:
其他好文 时间:
2019-11-08 18:59:51
阅读次数:
126