摘要:
自动化测试中,需要把测试的数据分离到JSON,YAML等文件中 #安装yml pip3 instsall pyyml 1. 在文件中写入json.json文件 { "login":{"username":"Maarten","password":"123456"} } 2. 写入一个函数de 阅读全文
posted @ 2022-06-21 19:55
LaraCroft
阅读(29)
评论(0)
推荐(0)
摘要:
在python里面,使用序列化和反序列化使用到的标准库是json 序列化:把Python对象(字典,列表,元组)转为字符串的过程(把第三方的内容写到文件中 dump()) 反序列化:把字符串转为Python对象(字典,列表,元组)的过程(从文件中读取数据 load()) 用途:主要用于数据分析和接口 阅读全文
posted @ 2022-06-21 18:44
LaraCroft
阅读(36)
评论(0)
推荐(0)
摘要:
# md5加上时间戳基本上没人能解import hashlib from urllib import parse import time def sign(): # time时间戳变为数字 dict1={"name":"wuya","age":18,"city":"xian",'time':time 阅读全文
posted @ 2022-06-21 18:24
LaraCroft
阅读(25)
评论(0)
推荐(0)
摘要:
time函数time模块提供了各种与时间有关系的库,比如暂停五秒中再执行就可以用到它:a.sleep(5) import time import time as a print('获取当前时间的时间戳:',a.time()) print('返回当前目前的字符串:',a.ctime()) print( 阅读全文
posted @ 2022-06-21 18:07
LaraCroft
阅读(248)
评论(0)
推荐(0)
摘要:
import osprint('查看模块所有的方法:\n',os.__all__)print('返回当前目录:',os.getcwd())print('获取目录下的所有文件和文件夹:')for item in os.listdir('D:\Temp'): print(item)print('获取文件 阅读全文
posted @ 2022-06-21 17:46
LaraCroft
阅读(63)
评论(0)
推荐(0)
摘要:
def add(a,b): print(a+b) add(3,2) 结果:5 def add(a,b=6): print(a+b) add(a=3) 结果:9 return 返回值 def login(username="wuya",password='admin'): if username==' 阅读全文
posted @ 2022-06-21 10:49
LaraCroft
阅读(50)
评论(0)
推荐(0)