上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 实现代码如下: #多线程 import threading import time class test: def test1(self,a): for i in range(3): print(a) time.sleep(2) def test2(self,b): for i in range(5 阅读全文
posted @ 2020-01-11 21:10 badbadboy 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 实现代码如下: #多进程 import time import multiprocessing class test: def test1(self,a): for i in range(3): print(a) time.sleep(1) def test2(self,b): for i in r 阅读全文
posted @ 2020-01-11 20:14 badbadboy 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 一、读写模式: w:向文件中写入内容,w会清空原来文本内容 a:向文件中追加内容 r:从文件中读取内容 wb:以二进制形式写入内容。 rb:以二进制形式读文件内容 ab:以二进制形式追加内容 a+、r+、w+:混合形式,即可读可写 二、读 1. 方法一: f = open(文件路径,读模式) #将文 阅读全文
posted @ 2020-01-11 19:22 badbadboy 阅读(701) 评论(0) 推荐(0) 编辑
摘要: #封包 def as1(*a): print(a) as1(1,2,3) #解包 def as2(a): print(*a) as2([1,2,3]) 阅读全文
posted @ 2020-01-11 19:13 badbadboy 阅读(481) 评论(0) 推荐(0) 编辑
摘要: #time库 import time #线程推迟时间 time.sleep(3) #时间戳 print(time.time()) #返回日期、时间、星期 print(time.strftime('%Y/%m/%d %H:%M:%S %A')) #返回时间信息元祖 print(time.localti 阅读全文
posted @ 2020-01-11 19:05 badbadboy 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 一、xc_case:存放测试用例脚本,xc_common:存放自动化测试脚本,xc_datas:存放测试数据和配置文件,xc_driven:存放浏览器驱动脚本,xc_report:存放生成的报 告,xc_tools:存放一些工具,get_main.py为执行程序 注:xc_common里的脚本为每个 阅读全文
posted @ 2020-01-09 21:11 badbadboy 阅读(528) 评论(0) 推荐(0) 编辑
摘要: #参数传递方式 a=1 b=22 #第一种 print(f'{a}hello{b}') #第二种 #整数:%d 小数:%f 字符串:%s print('%dhello%d'%(a,b)) 阅读全文
posted @ 2020-01-09 19:22 badbadboy 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1. 数字 #整型 print(int(3.41)) #浮点型 print(float(3)) #复数 print(complex(2,3)) #四舍五入为整数 print(round(3.45)) 2. 字符串 #字符串str a=' asaDf ' #转为字符串 b=12345 print(st 阅读全文
posted @ 2020-01-09 19:20 badbadboy 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 推荐:https://any86.github.io/any-rule/ 一、基本语法 1、[] [abc] 查找方括号之间的任何字符 [^abc] 查找任何不在方括号之间的字符 [0-9] 查找任何从0-9的数字 [A-z] 查找任何从大写A到小写z的字符 2、元字符 . 查找单个字符,除换行符 阅读全文
posted @ 2020-01-09 13:07 badbadboy 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1. html的class属性,class="light-chip alternate-fakebox show-fakebox-icon"的中间存在空格,表示有三个属性名称,定位时选取一个就好,不然无法定位到 阅读全文
posted @ 2020-01-08 20:44 badbadboy 阅读(294) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页