摘要: lambda的简单使用: func = lambda a1, a2: a1 + a2 func1 = lambda a3: a3/2 print(func(100, 200)) # 运行结果:300 print(func1(4)) # 运行结果:2.0 不使用lambda时的写法: def func 阅读全文
posted @ 2023-06-08 15:56 奔奔-武 阅读(50) 评论(0) 推荐(0) 编辑
摘要: views.py中的代码: from django.shortcuts import render from django.views import View class IndexViews(View): def get(self, request): datas = [ { "projects_ 阅读全文
posted @ 2021-06-06 16:33 奔奔-武 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1、使用allure serve查看报告: cmd窗口下输入:allure serve 报告目录 提示:allure-results does not exists 将生成的链接地址在浏览器中打开,报告为空: 2、使用allure的其它命令打开: cmd窗口输入:allure generate al 阅读全文
posted @ 2021-05-28 13:47 奔奔-武 阅读(3970) 评论(0) 推荐(0) 编辑
摘要: 1、打开cmd命令窗口 2、输入:jupyter notebook --generate-config,回车后会提示jupyter_lab_config.py文件的位置,如图: 3、打开jupyter_lab_config.py文件,添加以下代码: import webbrowser webbrow 阅读全文
posted @ 2021-05-27 10:26 奔奔-武 阅读(2087) 评论(0) 推荐(0) 编辑
摘要: 1、如果想在chrome浏览器上安装插件,使用Burp Suite抓取请求包时,首先需要下载安装SwitchyOmega_Chromium插件: 下载地址:https://github.com/FelisCatus/SwitchyOmega/releases,选择SwitchyOmega_Chrom 阅读全文
posted @ 2021-05-27 09:45 奔奔-武 阅读(4999) 评论(1) 推荐(0) 编辑
摘要: 一、安装 requests和jsonpath 模块 安装命令:pip install requests pip install jsonpath 二、requests 处理常见的接口请求参数类型 1、表单类型的参数:1)请求参数类型:content-type: application/x-www-f 阅读全文
posted @ 2020-11-03 13:28 奔奔-武 阅读(6428) 评论(0) 推荐(0) 编辑
摘要: 需要安装的第三方库: pip install -i https://pypi.douban.com/simple wordcloud pip install -i https://pypi.douban.com/simple jieba 需要解析的文字,放到了word.txt文本中: 1. 根据软件 阅读全文
posted @ 2020-10-27 16:19 奔奔-武 阅读(907) 评论(0) 推荐(0) 编辑
摘要: 它是 Python 内置的 HTTP 请求库,也就是说我们不需要额外安装即可使用 示例代码如下: 1 from urllib import request, parse 2 url = 'https://XX.XXXX.com/XX/XX/uaa/login' 3 headers = { 4 "x- 阅读全文
posted @ 2020-09-23 10:59 奔奔-武 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 使用python随机生成20位的数字+大写字母的密码: import random, string passwd = [] for i in range(20): if random.randint(0, 1): letter = random.choice(string.ascii_upperca 阅读全文
posted @ 2020-08-26 17:02 奔奔-武 阅读(2363) 评论(0) 推荐(0) 编辑
摘要: 如下代码: # 默认值如果是可变的数据类型. 每次使用的时候都是同一个 def extendList(val, list=[]): print(id(list)) list.append(val) return list list1 = extendList(10) list2 = extendLi 阅读全文
posted @ 2020-07-29 17:02 奔奔-武 阅读(188) 评论(0) 推荐(0) 编辑