上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 96 下一页
摘要: from threading import Threadfrom selenium import webdriverfrom time import ctime,sleep#测试用例def test_baidu(browser,search): print("start:%s" % ctime()) 阅读全文
posted @ 2020-01-18 22:34 干it的小张 阅读(212) 评论(0) 推荐(0) 编辑
摘要: """多进程multiprocessing模块的使用与多线程threading模块的用法类似。multiprocessing提供了本地和远程的并发性,有效地通过全局解释锁(Global Interceptor Lock,GIL)来使用进程(而不是线程)。由于GIL的存在,在CPU密集型的程序当中,使 阅读全文
posted @ 2020-01-18 22:32 干it的小张 阅读(131) 评论(0) 推荐(0) 编辑
摘要: import threadingfrom time import sleep,ctime#创建线程类:class MyThread(threading.Thread): def __init__(self,func,args,name=""): threading.Thread.__init__(s 阅读全文
posted @ 2020-01-18 22:30 干it的小张 阅读(180) 评论(0) 推荐(0) 编辑
摘要: """multiprocessing提供了threading包中没有的IPC(进程间通信),效率上更高。应优先考虑Pipe和Queue,避免使用Lock/Event/Semaphore/Condition等同步方式(因为它们占据的不是用户进程的资源)。multiprocessing包中有Pipe类和 阅读全文
posted @ 2020-01-18 22:29 干it的小张 阅读(171) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom time import sleep#创建page类:class Page(object): """ 基础类、用于页面对象类的继承 """ log 阅读全文
posted @ 2020-01-18 22:28 干it的小张 阅读(136) 评论(0) 推荐(0) 编辑
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 96 下一页