上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 140 下一页
摘要: 前言 使用 FastAPI,你可以定义、校验、记录文档并使用任意深度嵌套的模型(归功于Pydantic) List 字段 你可以将一个属性定义为拥有子元素的类型。例如 Python list: from typing import Union from fastapi import FastAPI 阅读全文
posted @ 2023-09-13 20:40 上海-悠悠 阅读(207) 评论(0) 推荐(0)
摘要: 前言 在 Flask 中,我们一般用蓝图 Blueprint 来处理多个模块的视图,在fastapi 中也有类似的功能通过APIRouter 来管理。 路由管理 APIRouter 如果你正在开发一个应用程序或 Web API,很少会将所有的内容都放在一个文件中。 FastAPI 提供了一个方便的工 阅读全文
posted @ 2023-09-12 14:11 上海-悠悠 阅读(1407) 评论(0) 推荐(0)
摘要: 前言 pydantic 一般是把传入的键值对,转成pydantic 对象. 我们希望将一个自定义的类对象,转成pydantic 模型,需在Config类中,设置属性orm_mode = True。开启from_orm()方法的使用 开启orm_mode pydantic 的 orm 模型默认是关闭的 阅读全文
posted @ 2023-09-12 08:15 上海-悠悠 阅读(939) 评论(0) 推荐(0)
摘要: # 前言 最近在运行pytest的时候,经常出现这个警告DeprecationWarning: pkg_resources is deprecated as an API See https://setuptools.pypa.io/en/latest/pkg_resources.html from 阅读全文
posted @ 2023-09-09 09:04 上海-悠悠 阅读(11194) 评论(2) 推荐(2)
摘要: 前言 pydantic 可以使用 EmailStr 校验邮箱格式 环境准备 EmailStr 需按依赖包ImportError: email-validator is not installed, run pip install pydantic[email] pip install pydanti 阅读全文
posted @ 2023-09-07 11:42 上海-悠悠 阅读(978) 评论(0) 推荐(0)
摘要: 前言 v1.4.5 新增功能。同一层级variables 变量中,可以引用前面的变量了 config 中 variables 可以引用同一层级变量 用例中 variables 可以引用同一层级变量 (备注:从v1.2.4 以后新版本不再公开,新功能内部 VIP 学员可以使用,公开版本仅解决bug, 阅读全文
posted @ 2023-08-29 19:54 上海-悠悠 阅读(306) 评论(0) 推荐(0)
摘要: # 前言 .pywinauto 可以使用 `print_control_identifiers()` 方法打印控件菜单树结构,这对我们查找控件非常方便。 # print_control_identifiers() 查看相关源码 ```python def print_control_identifi 阅读全文
posted @ 2023-08-26 14:55 上海-悠悠 阅读(1159) 评论(1) 推荐(0)
摘要: # 前言 pywinauto 查找窗口和控件时会有超时时间与轮询机制,可以通过timings 模块设置全局等待时间。 # timings 模块 timings 模块有三个模式可以设置 - timings.Timings.fast() 快速模式 - timings.Timings.defaults() 阅读全文
posted @ 2023-08-26 08:17 上海-悠悠 阅读(582) 评论(0) 推荐(0)
摘要: # 前言 pywinauto 操作鼠标,滚动查看 # 鼠标点击操作 单击鼠标左键, coords 参数是点击的坐标位置 ```python from pywinauto import mouse # 单击鼠标左键 mouse.click(coords=(100,100)) ``` 鼠标右击 ``` 阅读全文
posted @ 2023-08-25 17:40 上海-悠悠 阅读(1236) 评论(0) 推荐(0)
摘要: # 前言 pywinauto 在查找到多个相同控件时操作会报错,可以使用found_index 选择其中的一个 # 查找到多个 查找control_type="MenuBar" 的所有控件 ``` from pywinauto import Application app = Application 阅读全文
posted @ 2023-08-24 16:20 上海-悠悠 阅读(868) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 140 下一页