摘要:
import parameterizedimport unittestimport parameterizedimport unittest,BeautifulReport#数据驱动#代码驱动#关键字驱动data = [ ['admin','123456',True], ['admin','1122 阅读全文
摘要:
1、搭建测试环境 1、申请服务器 2、安装依赖的软件 jdk1.8、mysql、redis、tomcat等等 3、获取代码,修改配置文件,(编译、打包) 4、导入基础数据(建表、导入数据) 5、代码放到服务器上,启动 2、日常部署 1、拉取最新代码,修改配置文件,(编译、打包) 2、如果有变动的sq 阅读全文
摘要:
虚拟环境: pip install virtualenv e://virtual_envs #建个文件夹专门放虚拟环境的 cd e://virtual_envs virtualenv py3 #干净的环境,没有第三方模块,只有pip cd /User/virtual_envs/py3/bin #进入 阅读全文
摘要:
import multiprocessing,timedef down_load(): time.sleep(5) print("运行完了")if __name__ == '__main__': for i in range(5): p = multiprocessing.Process(targe 阅读全文
摘要:
#多个线程操作同一个数据的时候,就得加锁import threadingnum = 0lock = threading.Lock()#申请一把锁def add(): global num lock.acquire()#加锁 num+=1 lock.release()#解锁for i in range 阅读全文
摘要:
import threading,timedef down_load(): time.sleep(5) print("运行完了")for i in range(10): t = threading.Thread(target=down_load) t.setDaemon(True)#设置子线程为守护 阅读全文
摘要:
import requestsfrom hashlib import md5import threadingimport timedef down_load_pic(url): req= requests.get(url) m = md5(url.encode()) with open(m.hexd 阅读全文
摘要:
import threadingimport time#进程是多个资源的集合#线程是进程里面具体干活的#线程和线程之间是互相独立的start_time = time.time()def down_load(): time.sleep(5) print("运行完了")for i in range(10 阅读全文
摘要:
实例化的对象是谁,self就是谁 阅读全文