摘要: 安装第三方库 pip3 install opencv-python def scan_QR_opencv(): file_path = './file/data/screenshot.png' QR_image = cv2.imread(file_path) QR_detector = cv2.QR 阅读全文
posted @ 2023-07-06 17:40 sunshine阿星 阅读(150) 评论(0) 推荐(0)
摘要: 拿到二维码 使用playwright方法,通过元素截图 https://playwright.dev/python/docs/screenshots 导入第三方库 pip3 install pyzbar from pyzbar.pyzbar import decode from PIL import 阅读全文
posted @ 2023-07-06 11:28 sunshine阿星 阅读(276) 评论(0) 推荐(0)
摘要: yaml文件类型 mysql: host: 127.0.0.1 user: test port: 35039 db: test password: 1234567 dp_ip: - 192.168.0.1 - 192.168.0.2 - 192.168.0.3 读取后结果为 {'mysql': {' 阅读全文
posted @ 2023-07-03 17:08 sunshine阿星 阅读(50) 评论(0) 推荐(0)
摘要: 若仅转换时间格式使用strftime(),若需要做时间操作则使用strptime()。 strptime()中的p指parse(解析), 一般解析都是说对字符串进行解析, 所以strptime()方法是将字符串解析为时间元组。datetime.datetime.strptime() strftime 阅读全文
posted @ 2023-07-03 16:47 sunshine阿星 阅读(748) 评论(0) 推荐(0)
摘要: # 安装yaml插件 pip3 install PyYaml yaml_file:文件名称(路径) import yaml import os class Yaml: def __init__(self, yaml_file): self.yaml_file = yaml_file def read 阅读全文
posted @ 2023-06-28 19:08 sunshine阿星 阅读(57) 评论(0) 推荐(0)
摘要: 1. pytest之parametrize()实现数据驱动 方法:@pytest.mark.parametrize(args_name, args_value)name:参数名称value:参数值方法一:单个参数@pytest.mark.parametrize('caseinfo', ['张三',' 阅读全文
posted @ 2023-06-28 18:58 sunshine阿星 阅读(1034) 评论(0) 推荐(0)
摘要: # 安装pip3 sudo apt install python3-pip # 安装pytest插件 pip3 install pytest-playwright pip3 install playwright # 安装chromium firefox webkit等浏览器的驱动文件(内置浏览器)p 阅读全文
posted @ 2023-06-28 09:29 sunshine阿星 阅读(467) 评论(0) 推荐(0)
摘要: list 异构性:list中可以包含不同种类/不同类型的对象,嵌套列表 有序性:位置号或者分片来找到对应元素 (分片左闭右开 从0开始) 修改不影响原列表 本地可修改:在原列表中可以直接修改,生成新的列表 L = [1,2,3,4] L.append(5) 末尾增加一位L。insert(1,10)任 阅读全文
posted @ 2021-05-16 17:49 sunshine阿星 阅读(495) 评论(0) 推荐(0)
摘要: dic = {'a':1,'b':2,'c':3} lis =list(dic) print(lis) lis2 = list(dic.values()) print(lis2) 字典可以直接转化成list 第一步:list(dic) #转化key 第二步:list(dict.vaues()) #转 阅读全文
posted @ 2021-05-16 16:52 sunshine阿星 阅读(4807) 评论(0) 推荐(0)
摘要: 1. 方法一使用zip()函数: zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表 i = [1,2,3] #定义列表1 l = ['a','b','c'] #定义列表2 d= zip(l,i) #将对象l作为参数,将元素打包成元组,返回元 阅读全文
posted @ 2021-05-16 16:36 sunshine阿星 阅读(375) 评论(0) 推荐(0)