共 24 篇文章 |
|
python3 中引用 HTMLTestRunner.py 模块1、更改HTMLTestRunner.py模块中的代码。1、更改StringIO模块导入方式:2、self.outputBuffer=StringIO.StringIO() 改为self.outputBuffer= StringIO()3、python3.6.2字典无has_key方法:4、str没有decode方法,去掉decode转码方法。5、python3中print方法无>>2、运行run-run-运行的py文件。 阅138 转1 评0 公众公开 18-05-24 16:10 |
python3+Selenium+HTMLTestRunner 无法生成测试报告1、在windows环境,文件名要使用以下几种格式:path = ''''''''G:\\MyTest\\report\\'''''''' #定义path为文件路径path = r''''''''G:\MyTest\report'''''''&... 阅168 转1 评0 公众公开 18-05-22 10:57 |
# 说出下面list1,list2,list3的输出值# 许多人会错误的认为 list1 应该等于 [10] 以及 list3 应该等于 [''''''''a'''''''']。# def extendList(val,list=[]):def extendList(val, list=None): if list is None: list = [] list.append(val) return listlist1 = extendList(... 阅5174 转5 评0 公众公开 18-04-28 14:21 |
python 合并2个list1、a = [1,2,3]b = [4,5,6]c = [list(i) for i in zip(a,b)] #用zip函数进行组合,然后把返回的每个元素转listprint(c)结果:[[1, 4], [2, 5], [3, 6]] 阅56 转1 评0 公众公开 18-04-27 16:36 |
python提取字符串中的数字【正则表达式用法】(1)使用正则表达式,用法如下:## ^ 匹配字符串的开始。匹配一个可选的 x 字符 (换言之,它匹配 1 次或者 0 次 x 字符)。## 正则表达式中的点号通常意味着 “匹配任意单字符”既然是提取数字,那么数字的形式一般是:整数,小数,整数加小数;\d+匹配1次或者多次数字,注意这里不要写成*,因为即便... 阅2329 转3 评0 公众公开 18-04-25 17:13 |
Django 安装1、python已安装完成且python环境变量已设置;2、Django 下载地址:https://www.djangoproject.com/download/3、Django安装:下载Django安装包,解压到python安装目录,然后cmd进入到Django目录,执行python setup.exe install安装Django,Django将要被安装到Python的Lib下的site-packages;4、配置环境变量:将这2个目录添加到系统... 阅32 转0 评0 公众公开 18-03-13 10:21 |
Python eval()函数的使用 eval()官方文档里面给出来的功能解释是:将字符串string对象转化为有效的表达式参与求值运算返回计算结果;# 测试eval()函数的使用# 功能:将字符串str当成有效的表达式来求值并返回计算结果。# 语法: eval(source[, globals[, locals]]) -> value# 参数:# source:一个Python表达式或函数compile()返回的代码... 阅832 转2 评0 公众公开 18-03-08 10:36 |
Python实例1class tiga: def __init__(self): self.name='''''''''''''''' self.age=0 def display(self): print("person(''''''''%s'''''''','''''&... 阅19 转0 评0 公众公开 18-03-01 11:04 |
Pycharm无法导入已安装的模块已安装好的模块,在cmd环境下测试也正常,但是在Pycharm中无法正常导入。1、进入设置:2、选择Project Interpreter — Add Local... — 选择python.exe的安装地址;3、最后回到设置界面:Project Interpreter项选择Python安装目录下python.exe。 阅2549 转0 评0 公众公开 18-02-09 15:04 |