E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
RTThread
多线程一例
fromconcurrent.futuresimpo
rtThread
PoolExecutor#导入线程池fromthreadingimportcurrent_thread#从线程中导入查看当前线程的方法
real-admin
·
2019-12-20 00:00
python线程池
importtime#threadpool为线程池模块impo
rtthread
pooldeftest(str):printstrtime.sleep(2)if__name__=="__main__":startTime
我头贼铁
·
2019-12-19 04:26
线程之守护线程
impo
rtthread
ingfromtimeimportctime,sleepimporttimedefListenMusic(name):print("Beginlisteningto%s.
测试探索
·
2019-12-18 22:52
flask之分析线程和协程
fromthreadingimpo
rtThread
,current_th
tomjoy
·
2019-12-18 18:00
使用互斥锁
#_author:来童星#date:2019/12/17#互斥锁fromthreadingimpo
rtThread
,Lockimporttimen=100deffunc():globalnmutex.acquire
Crazy_Star
·
2019-12-17 15:00
线程间通信
#_author:来童星#date:2019/12/17fromthreadingimpo
rtThread
importtimedefplus():print('子线程1开始')globalnumnum+
Crazy_Star
·
2019-12-17 15:00
使用Thread创建线程
#_author:来童星#date:2019/12/17#使用Thread创建线程impo
rtthread
ingimporttimeclassSunthread(threading.Thread):defrun
Crazy_Star
·
2019-12-17 14:00
使用threading模块创建线程
#_author:来童星#date:2019/12/17#使用threading模块创建线程impo
rtthread
ing,timedefprocess():foriinrange(3):time.sleep
Crazy_Star
·
2019-12-17 14:00
python3 开启多线程的两种写法
写法一importtimefromthreadingimpo
rtThread
deffunc(name):print(f"{name}开始")time.sleep(0.5)print(f"{name}结束
lilyxiaoyy
·
2019-12-17 14:00
Python-day-18多线程
多线程技术1python内置的threading模块,可以支持多线程所有的进程默认都有一个线程(一般叫这个线程为主线程),其他的线程叫子线程如果想要在进程中添加其他的线程,就创建线程对象"""impo
rtthread
ingimporttimedefdownload
sawyerwh
·
2019-12-17 05:44
Python3發送多線程請求
importrequestsimportjsonimpo
rtthread
ingimporttimeimportuuidimportrandomimportdatetimeimportredisimportloggingimportnumpyasnpimportmathpool
报告老师
·
2019-12-16 22:58
添加多线程
impo
rtthread
ingdefthread_job():print("thisisanaddedThread,numberis%s"%threading.current_thread())defmain
Do_More
·
2019-12-16 19:23
线程
三.实例一impo
rtthread
ingimporttimedefmusic(name):print('beginlistening%sat%s'%(name,ctime()))sleep(2)print
居一雪
·
2019-12-15 23:00
python,用event方法实现线程间通信控制
impo
rtthread
ing,timeclassBoss(threading.Thread):defrun(self):print("Wemustworktoday!")
Iceberg_710815
·
2019-12-15 12:00
python,信号量,semaphore
python中的信号量,是通过定义semaphore对象,控制同时可以运行的线程的数量,同时也是一种锁,下面的代码演示了信号量的应用impo
rtthread
ing,timeclassMyThread(threading.Thread
Iceberg_710815
·
2019-12-15 11:00
Python3.x:threading module区分主/子线程与守护进程简析
提供给我们方法让我们可以知道当前线程是主线程还是子线程让我们来看一下:threading.current_thread()#当前线程类型threading.active_count()#当前活跃线程数实例:impo
rtthread
ingimporttime
james_chang
·
2019-12-15 03:51
并行计算
>>>impo
rtthread
ing>>>defthread_hello():other=threading.Thread(target=thread_say_hello,args=())other.start
Rim99
·
2019-12-15 03:52
Python 34 Programming Tutorial - threading
impo
rtthread
ingclassBuckysThread(threading.Thread):defrun(self):for_inrange(10):print(threading.currentThread
豆表示低调
·
2019-12-14 20:34
python,通过创建类实现多线程例子
impo
rtthread
ing,timeclassMyThread(threading.Thread):def__init__(self,num):threading.Thread.
Iceberg_710815
·
2019-12-14 19:00
python、大麦、抢票、周杰伦
selenium来抢票试试,抢了一次,页面挤爆后退出了;这是优化后的,挤爆后会刷新继续抢;看代码吧:importplatformimportrandomimporttimefromthreadingimpo
rtThread
importrequestsfromseleniumimportwebdriverfromselenium.common.exceptionsimportNo
把爱放下会走更远
·
2019-12-14 17:26
主线程与子线程的关系
通过一下示例:fromthreadingimpo
rtThread
impo
rtthread
ingdeffunc1():print('f1',threading.current_thread().name)
躺云飘
·
2019-12-14 17:00
tornado中,异步执行阻塞代码
importtimeimportdatetimeimporttornado.ioloopimporttornado.webimporttornado.genimporttornado.concurrentfromconcurrent.futuresimpo
rtThread
PoolExecutorclassMainHandler
第八共同体
·
2019-12-14 13:42
python多线程爬取百度云电影网站
importqueueimpo
rtthread
ingimportrequestsimportrefromlxmlimportetreeimporttimeimportrandomimportjson#已爬
NO123456
·
2019-12-13 13:29
锁
因为争夺资源而造成的一种互相等待的现象,若无外力作用,他们都将无法推进下去,此时系统处于死锁状态或系统产生了死锁,这些永远在等待的进程称为死锁进程死锁-------------------fromthreadingimpo
rtThread
阿浪阿浪
·
2019-12-13 12:00
python 线程池实用总结
线程池的两张方法submit和mapfromconcurrent.futuresimpo
rtThread
PoolExecutorimporttime#defsayhello(a):time.sleep(
市丸银
·
2019-12-13 10:00
python学习笔记之七[斗图网爬虫]
page=1#coding:utf-8importrequestsimpo
rtthread
ing#多线程处理与控制fromlxmlimportetree#解析网页frombs4importBeautifulSoup
王滕辉
·
2019-12-13 09:30
利用matplotlib实现根据实时数据动态更新图形
fromtimeimportsleepfromthreadingimpo
rtThread
importnumpyasnpimportmatplotlib.pyplotaspltfrommatplotlib.widgetsimportButtonfig
cakincqm
·
2019-12-13 09:47
死锁
#coding=utf-8impo
rtthread
ingimporttime#创建互斥锁lockA=threading.Lock()lockB=threading.Lock()classMythread1
Chaweys
·
2019-12-13 02:49
Ajax简单应用之个人简历页面搭建
代码实现:1#1.导入socket模块2importsocket3impo
rtthread
ing456#创建服务器类7classHttpServerSocket(object):8#给服务器类的对象设置属性
老王同鞋
·
2019-12-11 23:00
Python开发测试工具案例分享⑦——老化测试实现代码
Main_LH.py#-*-coding:utf-8-*-fromPyQt4importQtCoreimportos,time,socket,datetime,codecsimpo
rtthread
importparamikoimportConfigParserimportsysimportgcreload
疯狂的机器人
·
2019-12-09 09:00
Python之HTTP静态服务器-面向对象版开发
1#1.导入socket模块2importsocket3#importgevent4impo
rtthread
ing567#创
老王同鞋
·
2019-12-08 22:00
Python之threading模块的使用
/usr/bin/envpython#-*-coding:utf-8-*-impo
rtthread
ingdefworker():print('worker...')threads=[]foriinrange
小粉优化大师
·
2019-12-08 16:00
Python的socket聊天脚本。
服务器端:#-*-coding:utf-8-*-importsocketimpo
rtthread
ingclassSock_Server:def__init__(self):self.host='192.168.1.11
就是想学习
·
2019-12-07 23:00
Python中的Tcp协议应用之TCP服务端-线程版
TCP服务端-线程版代码实现:1importsocket2impo
rtthread
ing345defhandle_client_socket(new_socket,ip_port):6print("建立连接成功
老王同鞋
·
2019-12-07 16:00
多线程编程---python
同步原语少#-*-coding:UTF-8-*-impo
rtthread
fromtimeimportsleep,ctimedefloop0():print'startloop0at:',ctime()sleep
sssnowyue
·
2019-12-07 10:20
Mr.Li--python-系统编程-线程
线程多线程--threadingpython的thread模块是比较底层的模块,python的threading模块是对thread做了一些包装的,可以更加方便的被使用使用threading模块impo
rtthread
ingimporttimedefsaySorry
界面大叔
·
2019-12-07 01:57
Python 多进程
1.进程#这段代码在pycharm中可能不出结果,可以放到cmd中运行impo
rtthread
ingimportmultiprocessingimporttimedefsubTest():print('
wztshine
·
2019-12-03 22:00
python 装饰器之应用示例
importtimeimporthashlibimportpickleimpo
rtthread
ing#装饰函数缓存应用cache={}defis_obsolete(entry,duration):returntime.time
假面佛
·
2019-12-02 23:00
创意编程,Python开发多功能壁纸自动切换工具!
importctypesimporttimeimportrequestsimportosfromthreadingimpo
rtThread
fromtkinterimportTk,Label,Button
Python学习啊
·
2019-12-02 16:00
Python多线程
1.多线程的实现方式第一种是调用方法impo
rtthread
ingimporttimedefget_detail_html(url):print("getdetailhtml")time.sleep(2
人生苦短啊
·
2019-12-02 09:33
java应用多线程批量更新脚本
灰度环境更新脚本执行方式:pythondeploy.py(all|appname)importos,sysimportparamikoimportselectimporttimeimportreimpo
rtthread
ing
疲马羁禽
·
2019-12-02 07:09
2018-10-29渔船数据的两种信号报表及图片输出
importosimportdatetimeimportpymysqlimportmatplotlib.pyplotaspltfrompylabimportmplimporttimeimportxlwtimportxlrdimpo
rtthread
ingimportpandasaspdimportglobfrommatplotlib.font_managerimpor
加勒比海带_4bbc
·
2019-12-02 05:47
图片转pdf生成器
按文件名排序#-*-coding:utf-8-*-importosfrompathlibimportPathimporttimefromthreadingimpo
rtThread
,current_threadfromtkinterimportTk
slords
·
2019-12-02 00:36
2018-10-11渔船数据的两种信号报表及图片输出
importosimportdatetimeimportpymysqlimportmatplotlibimportmatplotlib.pyplotaspltfrompylabimportmplimporttimeimportxlwtimportxlrdimpo
rtthread
ingimportpandasaspdimportglobfrommatplotlib.f
加勒比海带_4bbc
·
2019-12-01 22:00
python 多线程、线程锁、事件
1.多线程的基本使用impo
rtthread
ingimporttimedefrun(num):print('Num:%s'%num)time.sleep(3)ifnum==4:print('Threadisfinished
wztshine
·
2019-12-01 14:00
Python多进程
1.多进程实现斐波那契对于耗费cpu的操作,多进程由于多线程,我拿斐波那契进行比较发现多进程速度远远高于多线程#多线程importtimefromconcurrent.futuresimpo
rtThread
PoolExecutor
人生苦短啊
·
2019-12-01 09:45
frida基础应用
/usr/bin/envpython2#-*-coding:utf-8-*-importsysimportfridaimpo
rtthread
ingdefget_usb_iphone():dManager
KinKen
·
2019-11-29 12:37
Python开发测试工具案例分享⑤——功能测试实现代码
,codecsimporttelnetlib#telnet连接模块importparamiko#ssh连接模块importConfigParser#配置文件模块importsys,socketimpo
rtthread
疯狂的机器人
·
2019-11-28 09:00
Python中的套接字编程
服务器端:importsocketimporttimeimpo
rtthread
inghost=socket.gethostname()port=12345s=socket.socket(socket.AF_INET
敢梦敢当
·
2019-11-28 06:26
俄罗斯方块
#coding=utf-8fromtkinterimport*fromrandomimport*impo
rtthread
ingfromtkinter.messageboximportshowinfofromtkinter.messageboximportaskquestionimpo
rtthread
ingfromtimeimportsleepclassBrickGame
氧气2019
·
2019-11-24 18:00
上一页
53
54
55
56
57
58
59
60
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他