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
python多线程爬虫案例
#coding=utf-8importrequestsfromlxmlimportetreefromqueueimportQueueimpo
rtthread
ingclassNuoMi: def__init
猫哥的鱼库
·
2018-07-02 22:38
python爬虫案例
利用python多进程与多线程爬取小说
importpandasaspdimportrequestsfromlxmlimportetreeimportmultiprocessingimpo
rtthread
ingfromfunctoolsimportpartialimportdatetimeimporttimebase_url
angusemma
·
2018-06-30 14:15
Python3学习(二十四):python中的线程之semaphore信号量
来看下面的代码:importtimeimpo
rtthread
ingdeffoo():time.sleep(2)#程序休息2秒print("ok",time.ctime())for
猪笨是念来过倒
·
2018-06-26 11:11
Python
python socket 实现 TCP客户端, 以及TCP服务端
开发人员可以使用大量的第三方python工具创建网络客户端和服务器,这些第三方工具的核心模块是socket模块这个模块展示了快速创建TCP服务端及客户端,使用原始套接字等所必须的代码.importsocketimpo
rtthread
ingdeftcp_client
医然
·
2018-06-26 00:30
Python|多任务:线程、进程、协程--你想要的都在这里
3.并行:真的多任务2.Pyhon3.X中创建多线程的两种方法:2.1法一:导入threading包的方法:关键几步代码: impo
rtthread
ing t=threading.Thread(target
DefaultTest
·
2018-06-26 00:00
rpyc + plumbum 实现远程调用执行shell脚本
可以很方便实现远程方法调用,而plumbum则可以实现在python中类似shell的方式编码:具体实现代码如下:Server.pyimportrpycfromrpyc.utils.serverimpo
rtThread
edServerfromplumbumimportlocalfromplumbum.cmdimportshclassCalculatorService
堕落门徒
·
2018-06-25 22:00
【python】多线程爬虫实例
#-*-coding:utf-8-*-fromlxmlimportetreeimportrequestsfromQueueimportQueueimpo
rtthread
ingimporttimeimportjsonclassthread_crawl
evan_qb
·
2018-06-21 23:42
⑦机器学习
python实时监控cpu小工具
_*_coding:utf-8_*_importreimportosimportwximpo
rtthread
importp
Cloud_Huan
·
2018-06-21 11:10
Python使用Threading创建Thread实例
impo
rtthread
ingfromtimeimportsleep,ctime'''Python使用Threading创建Thread实例'''#不必使用线程锁#使用这个方法可以实现同步线程loops
Vlad Craste
·
2018-06-19 23:01
python主线程捕获子线程的方法
先看一个线程类的定义'''''CreatedonOct27,2015@author:wujz'''impo
rtthread
ingclassrunScriptThread(threading.Thread
汤姆维赛迪
·
2018-06-17 08:33
线程与进程-运行时间算法1
impo
rtthread
ingimporttimefromconcurrent.futuresimpo
rtThread
PoolExecutor,waitimportfireasfiredefeach_task
csdngaoqingrui
·
2018-06-15 15:50
Python3
使用python爬虫获取黄金价格的核心代码
获取每天黄金价格@author:yufei@site:http://www.antuan.com2017-05-11"""importreimporturllib2,urllibimportrandomimpo
rtthread
ingimportt
努力一方
·
2018-06-13 11:03
Python 的threading.local方法
#coding=utf-8impo
rtthread
ing#创建全局ThreadLocal对象:localVal=threading.local()localVal.val="Main-Thread"defprocess_student
莺声门径
·
2018-06-10 16:01
Python编程
获取ping中的丢包和网络时延
/usr/bin/envpython#coding:utf-8importsubprocessimportreimportsysimportosimpo
rtthread
ingmlock=threading.Lock
小王同学123321
·
2018-06-08 12:56
python3 Serial 串口助手的接收读取数据
#coding=gb18030impo
rtthread
ingimporttimeimportserialclassComThread:def__init__(self,Port='COM3'):self.l_serial
crazyBird_GJY
·
2018-06-08 09:57
python
python使用tomorrow实现多线程
importtime,requestesfromtomorrowimpo
rtthread
s@threads(10)#使用装饰器,这个函数异步执行defdownload(url):returnrequests.get
Cosmop01itan
·
2018-06-07 23:32
python
python使用tomorrow实现多线程
importtime,requestesfromtomorrowimpo
rtthread
s@threads(10)#使用装饰器,这个函数异步执行defdownload(url):returnrequests.get
Cosmop01itan
·
2018-06-07 23:32
python
10.多线程与多进程编程
语言中一个线程3.gil使得同一时刻只有一个线程在cpu上执行字节码,无法将多个线程映射到多个cpu上4.gil会根据执行的字节码行数以及时间片释放gil5.gil在遇到io操作的时候会主动释放impo
rtthread
ingtotal
书山压力大EEE
·
2018-06-06 18:44
python高级编程
python threading 多线程
举例:impo
rtthread
ingdefthread_func(x):print('%d\n'%(x*100))threads=[]foriinrange(5):#5个线程threads.append
Mr-Cat伍可猫
·
2018-06-05 13:59
python
web
crawler
实用自动化运维Python脚本分享
/usr/bin/python#-*-coding:UTF-8-*-importparamikoimportsysimpo
rtthread
ing#Copylocalfiletoremoteserver.defsshclient_scp
renfengjun
·
2018-06-04 10:57
蒸包子
impo
rtthread
ing,timezhenglong=[]zheng_lock=threading.Lock()W=threading.Condition(lock=zheng_lock)chi_lock
liuruize123
·
2018-06-04 01:06
python中多线程
多线程基本概念:线程:进程中的每个子任务,不能独立存在,CPU执行的最小单位进程:独立的所有子任务的集合即:多个线程组成进程impo
rtthread
ingprint([xforxinrange(9)])
Angelayouran
·
2018-06-01 23:43
实战:python 找错
这里想写复杂一点,写成startendimpo
rtthread
ingimportmathtotal=0end=0start=0defthreadnum(startl,endl,num_thread):globalendglobalstartprint
Girl_endless
·
2018-06-01 11:26
python +cv2实现视频流播放
/usr/bin/envpython3#-*-coding:utf-8-*-importcv2 impo
rtthread
ingclassProducer(threading.Thread): "
jiadianyong12138
·
2018-05-24 13:07
Python学习笔记(十二)ThreadLocal及分布式进程
直接看代码:impo
rtthread
inglocalobj
alvin_2005
·
2018-05-24 08:36
学海无涯
Python
python 爬虫一键爬取 淘宝天猫宝贝页面主图颜色图和详情图的教程
实例如下所示:importrequestsimportre,sys,osimportjsonimpo
rtthread
ingimportpprintclassspider:def__init__(self
mzbqhbc12
·
2018-05-22 15:40
python进阶宝典16- 多线程与外部调用
impo
rtthread
ing,timeprint('Sta
周雄伟
·
2018-05-20 22:40
python
python——多线程
多线程-threadingimporttimefromthreadingimpo
rtThread
#如果多个线程执行的是同一个函数的话,各自之间不会有影响deftest():print("哈哈哈哈哈哈哈"
Jalynn葸
·
2018-05-17 17:35
python暴力破解zip密码文件
/usr/bin/pythonimportzipfileimpo
rtthread
ingdefextractfile(zFile,password): try: zFile.extractall(
pySVN8A
·
2018-05-16 19:43
Python
多进程多线程的坑
frommultiprocessingimportProcessimpo
rtthread
ingimporttimeclassJob:def__init__(self):self.a='a'defrun(
何时休
·
2018-05-16 11:59
python
python系统编程(十一)
同步应用多个线程有序执行fromthreadingimpo
rtThread
,LockfromtimeimportsleepclassTask1(Thread):defrun(self):whileTrue
瀛洲小李
·
2018-05-14 17:00
多线程 同步对象 event 简单实例 &进程间通信
多线程同步对象eventimpo
rtthread
ing,timeclassBoss(threading.Thread):defrun(self):print("BOSS:今晚大家都要加班到22:00。"
xiaoshi657
·
2018-05-13 23:00
python爬虫-多线程小说批量下载
跳过并下载下一个文件#增加了:多线程,可同时download多个文件2018.1.11importrequestsfrombs4importBeautifulSoupimporttimeimportosimpo
rtthread
ingclassBook1
昨夜风起_jzb
·
2018-05-09 11:54
python爬虫
Python网络编程之多线程
多线程多线程举例:impo
rtthread
ingfromtimeimportsleep,ctimedefsing():foriinrange(3):print("正在唱歌...
Dylan HU
·
2018-05-06 23:21
Python编程
Linux编程
python并发
各种池用于量大但简单并发操作concurrent使用到了concurrent.futures模块以下代码进程线程通用关键字换一下就行future对象fromconcurrent.futuresimpo
rtThread
PoolExecutorimporttimedefworking
593393454
·
2018-05-03 19:39
Python---事件Event
设置标志位event.clear()#清空标志位event.wait()#等待设置标志位红绿灯实例:#红绿灯'''标志位设定,代表绿灯,直接通行;标志位被清空,代表红灯;wait()等待变绿灯'''impo
rtthread
ing
风从北方来
·
2018-05-02 14:26
Python高级基础
python核心---socket编程实现聊天室
1.udp方式fromthreadingimpo
rtThread
fromsocketimport*defrecvData():whileTrue:recvInfo=udpSocket.recvfrom(
OnlyLove_琳
·
2018-04-26 10:34
python核心
Python:两个使用单例模式的方法
Method1、impo
rtthread
ingclassSingleton(object):_instance_lock=threading.Lock()def__init__(self):passdef
chnyac
·
2018-04-26 08:59
Python
批量跑性格测试小程序
写成python脚本批量跑importrequestsimportjsonimportreimpo
rtthread
ingheaders={"Upgrade-Insecur
黑面狐
·
2018-04-25 19:01
Python
爬虫大作业之爬取笔趣阁小说
#_*_coding:utf-8_*_importrequestsimpo
rtthread
ingfrombs4importBeautifulSoupimportreimportosimporttimereq_header
dengchen1872
·
2018-04-24 21:00
爬虫
移动开发
python
强行停止python子线程最佳方案
impo
rtthread
ing importtime importinspect importctypes def_async_raise(tid,exctype): """raisestheexception
熊彬彬
·
2018-04-23 14:35
Python从搭建到移除
2018-04-17生产者与消费者模式、ThreadLocal、异步、GIL
生产者与消费者:解决多任务中数据缓存的问题,能够解耦解决数据生产方和数据处理方的数据缓存问题#encoding=utf-8impo
rtthread
ingimporttime#python2中fromQueueimportQueue
菩灵
·
2018-04-17 20:15
Python协程之socket单线程下使用协程实现高并发
先来看看服务端代码:importsys,socket,time,geventfromgeventimportsocket,monkeymonkey.patch_all()impo
rtthread
ingdefserver
haeasringnar
·
2018-04-17 18:53
Python
Python协程之异步同步区别
importgeventimpo
rtthread
ingimportmultiprocessing#这里展示同步和异步的性能区别,可以看到异步直接同时执行并完成,#而同步,需要等待第一个完成后再次执行下一个
haeasringnar
·
2018-04-17 18:15
Python
python3 将项目日志 集中输出
开发环境:win10+python3.6.4运行环境:linux+python3.6.5代码:importtimeimpo
rtthread
ingimportconfigparser
年轻的酒仙
·
2018-04-17 17:40
python
Python解决GIL锁的办法
这个并没有解决数据共享出现不同步的问题#-*-coding:utf-8-*-impo
rtthread
ing#子线程死循环deftest():whileTrue:passt1=threading.Thread
不懂就要问00XCAFEBABY
·
2018-04-16 23:33
Python
并行编程
Python线程(二)之同步与异步
如进程、线程同步,可理解为进程或线程A和B一块配合,A执行到一定程度时要依靠B的某个结果,于是停下来,示意B运行;B依言执行,再将结果给A;A再继续操作多个线程有序执行fromthreadingimpo
rtThread
不懂就要问00XCAFEBABY
·
2018-04-16 22:10
#
Python
并行编程
Python批量跑Hive数据到本地目录
BiDataProc/love/HiveRunData2LocalFile.py#-*-coding=utf-8-*-importosimportdatetimeimportwarningsimporttimeimpo
rtthread
p
BabyFish13
·
2018-04-16 10:08
Python
Solution
Python批量跑Hive数据到本地目录
BiDataProc/love/HiveRunData2LocalFile.py#-*-coding=utf-8-*-importosimportdatetimeimportwarningsimporttimeimpo
rtthread
p
BabyFish13
·
2018-04-16 10:08
Python
Solution
Python实现定时精度可调节的定时器
本文实例为大家分享了Python实现定时精度可调节的定时器,供大家参考,具体内容如下#-*coding:utf-8-*-importsysimportosimportgetoptimpo
rtthread
ingimporttimedefUsage
ccpw_cn
·
2018-04-15 15:21
上一页
65
66
67
68
69
70
71
72
下一页
按字母分类:
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
其他