![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
梧桐叶123
这个作者很懒,什么都没留下…
展开
-
python之协程
python之协程原创 2022-06-05 22:22:45 · 202 阅读 · 0 评论 -
python知识点
一、将list转换为stringlist1=[1,'ab','c']list1_str ="".join([str(x) for x in list1])运行结果:二、将string转换为liststring1 ='abc124'list_string = list(string1)list_string运行结果原创 2021-11-29 15:54:31 · 517 阅读 · 0 评论 -
python读取文件
一、问题:python读取文件,路径带有中文,报错:找不到文件 处理方法:将字符串转码:filePath.decode("utf-8").encode("gbk")原创 2021-09-08 10:55:22 · 45 阅读 · 0 评论 -
python安装第三方包报错及解决方法
一、安装beautifulsoup4-4.9.3-py3-none-any.whl报错报错内容:Could not find suitable distribution for Requirement.parse(‘soupsieve>1.2’)原因:显示soupsieve需要大于1.2的版本,说明本地没有soupsieve或者版本过低解决方法:1、在https://pypi.org/ 找到soupsieve,下载最新的whl文件2、安装soupsieve新版本pip install so原创 2021-09-03 10:38:33 · 3588 阅读 · 1 评论 -
python依赖包安装
一、安装依赖包的三种方式1、pip2、源码安装3、exe安装二、pip安装格式:pip install 包三、源码安装1、打开链接:https://pypi.org/project/2、下载安装包3、将包复制到${python}\scripts,进行解压${python}为python的安装路径4、在命令窗口cmd,进入到解压包路径下,进行安装:python setup.py install5、安装成功pip3 freeze/list查看四、exe安装切换到安装的exe原创 2021-09-03 09:37:33 · 6429 阅读 · 2 评论 -
python线程总结
参考文档:https://zhuanlan.zhihu.com/p/157172582一、线程创建import threading t = Thread.threading(target =func,name='threadName',args=(x,y))target为:功能name:线程名称,可忽略args:参数二、循环打印数字例子import threadingimport timedef loop(n): print("thread %s is running...."%(转载 2021-08-21 11:34:34 · 127 阅读 · 0 评论 -
python+pytest+allure生成测试报告
一、下载allurehttps://github.com/allure-framework/allure2/releases/tag/2.7.0注意:python 为3.7版本的,安装这个2.7版本,否则会展示不出来解压zip包,创建环境变量:设置环境变量成功后,在cmd输入命令:allure --version,展示如下,说明安装allure成功二、安装第三方插件allure-pytest:下载 allure-pytest 插件,用来生成 Allure 测试报告所需要的数据。pip3原创 2021-07-05 23:05:58 · 559 阅读 · 2 评论