From 95a7ce39e81dd2377074ae27141b3837716c864f Mon Sep 17 00:00:00 2001 From: deipss Date: Wed, 8 May 2024 20:44:56 +0800 Subject: [PATCH] data --- docs/Python/Pytest.md | 65 +++++++++++++++++++ ...70\347\224\250\350\257\255\345\217\245.md" | 2 +- ...5\344\275\234\346\200\273\347\273\223 .md" | 4 +- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/docs/Python/Pytest.md b/docs/Python/Pytest.md index 68ccf15..e4fb282 100644 --- a/docs/Python/Pytest.md +++ b/docs/Python/Pytest.md @@ -4,3 +4,68 @@ title: Pytest parent: Python --- +# 文件加载 + +## path +```phthon +import json +import os +import yaml +if __name__ == '__main__': + print(__file__) + relpath = os.path.relpath(__file__) + print(os.path.split(relpath)) + print(relpath) + print(os.getcwd()) + + + path = os.path.join('dir1', 'dir2', 'file.txt') + print(path) +``` + +## json yaml +```python +import json +import os +import yaml +if __name__ == '__main__': + with open("demo.yaml", "r") as file: + data = yaml.safe_load(file) + print(data) + print(data['json']) + + with open("demo.json", "r") as file: + data = json.load(file) + print(data['sites']) +``` + + +# Pytest + + + +# Allure + + +# Client + + +## mysql + + +## rocketmq + + +## redis + + +## es + + +# log + + +# python 部署 + +## 搜索可用的版本包 +pip install requests== diff --git "a/docs/Python/\345\270\270\347\224\250\350\257\255\345\217\245.md" "b/docs/Python/\345\270\270\347\224\250\350\257\255\345\217\245.md" index d96d859..fe29f04 100644 --- "a/docs/Python/\345\270\270\347\224\250\350\257\255\345\217\245.md" +++ "b/docs/Python/\345\270\270\347\224\250\350\257\255\345\217\245.md" @@ -525,6 +525,7 @@ if __name__ == '__main__': # 模块和包 每一个以 .py 结尾的python文件就是一个模块。 +包是一个一个文件夹,下面有许多的模块 ```python import 模块名 # 导入单个模块 @@ -538,7 +539,6 @@ from time import sleep # 只导入模块中的sleep方法 from 模块名 import * from time import * # 只导入模块中所有的函数 - ``` diff --git "a/docs/Reading/\344\270\200\344\270\252\346\265\213\350\257\225\347\232\204\344\270\211\345\271\264\345\267\245\344\275\234\346\200\273\347\273\223 .md" "b/docs/Reading/\344\270\200\344\270\252\346\265\213\350\257\225\347\232\204\344\270\211\345\271\264\345\267\245\344\275\234\346\200\273\347\273\223 .md" index 90d2202..9224f0e 100644 --- "a/docs/Reading/\344\270\200\344\270\252\346\265\213\350\257\225\347\232\204\344\270\211\345\271\264\345\267\245\344\275\234\346\200\273\347\273\223 .md" +++ "b/docs/Reading/\344\270\200\344\270\252\346\265\213\350\257\225\347\232\204\344\270\211\345\271\264\345\267\245\344\275\234\346\200\273\347\273\223 .md" @@ -3,7 +3,9 @@ layout: default title: 测试工程师的三年工作总结 parent: Reading --- -- https://mp.weixin.qq.com/s?__biz=MzkxMDM1NDQ0OA==&mid=2247501092&idx=2&sn=ff6fe29c32b0590feedd2577002600e8&chksm=c12e345bf659bd4d887eebffbdd2b3315bc0476431ef0a7e1f5da826be51bed24ddd686e46e4&scene=21#wechat_redirect + + +- 原文 https://mp.weixin.qq.com/s?__biz=MzkxMDM1NDQ0OA==&mid=2247501092&idx=2&sn=ff6fe29c32b0590feedd2577002600e8&chksm=c12e345bf659bd4d887eebffbdd2b3315bc0476431ef0a7e1f5da826be51bed24ddd686e46e4&scene=21#wechat_redirect # 文摘