![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
文章平均质量分 58
早点下班吧
这个作者很懒,什么都没留下…
展开
-
Python ddt数据驱动使用,跳过用例操作
文章目录excel数据准备代码准备operate_excel.pyddt_use.py执行后的报告 excel数据准备 test.xlsx 代码准备 operate_excel.py import openpyxl import log class ReadExcel: """读取 excel 用于 ddt 数据驱动""" def __init__(self, excel_path, sheet_name='Sheet1'): self.data = openpyxl.原创 2021-04-26 11:06:24 · 464 阅读 · 1 评论 -
工作中与python2和python3相关的知识
一:python2和python3在Windows或linux下的切换 windows安装完python2和3后,在cmd中输入python,会进入到当前系统环境优先级最高的python版本 Win10中调换版本的方法就是改变其在path中的位置,系统默认python版本为靠前的环境变量,如下图中默认就是python2,如果想改变系统默认python为3,将python3环境变量上调到python2前面保存设置即可,然后再cmd中输入python(注意重启cmd) 慎用:执行以下操作需要保证自己知晓pyt原创 2020-12-25 17:33:27 · 97 阅读 · 0 评论 -
Python之cls,self在类中的区别
```python class A(object): a = 'a' @staticmethod # 类中方法调用,属性引用 def foo1(name): print ('hello', name) # A.foo3('hi') # 报错 # print(A.a) # 输出正常 def foo2(self, name): print ('hello', name) # se.原创 2020-12-25 11:44:52 · 159 阅读 · 0 评论