2020
09-28
09-28
如何配置关联Python 解释器 Anaconda的教程(图解)
首先先安装好我们的Python这里就不多介绍了1.打开python.exe:点击File下的小扳手图标Settings…2.打开设置界面:我们点击Project这一栏下的ProjectInterpreter之后我们点击红色小方框的小箭头3.选择环境变量:我们选择已有的两个环境变量中的其中一个Python3.7点击下方的Apply等他加载成功后我们点击OK就完成了。4.选择环境变量:另一种情况我们发现下拉列表中没有可选择的环境变量时,点击右边的小齿轮,然后点击...
继续阅读 >
http_request2.py用于发起http请求#读取多条测试用例#1、导入requests模块importrequests#从class_12_19.do_excel1导入read_data函数fromdo_excel2importread_datafromdo_excel2importwrite_datafromdo_excel2importcount_case#定义http请求函数COOKIE=Nonedefhttp_request2(method,url,data):ifmethod=='get':print('发起一个get请求')result=requests.get(url,data,cookies=COOKIE)else:print('发起一个pos...
接口压力测试500次,查看响应时间importjsonimportrequestsimportlogginglogging.basicConfig(level=logging.INFO,format='%(asctime)s-%(name)s-%(levelname)s-%(message)s')logger=logging.getLogger(__name__)restime=[]OK=[]classRestime():defAPI(self,URL2,param):try:r=requests.get(URL2,params=param,timeout=10)r.raise_for_status()#如果响应状态码不是200,就主动抛出异常exceptre...