PYTHON之多线程
2016-11-08 21:52
141 查看
import threading import time def run(name): print "i am mult-threding",i time.sleep(2) for i in range(20): t=threading.Thread(target=run,args=(i,)) t.start() class mythread(threading.Thread): def __init__(self,num): threading.Thread.__init__(self) self.num=num def run(self): print "i am thread %s"% self.num time.sleep(2) print "OK" for i in range(20): t=mythread(i) t.start()
相关文章推荐
- Python 多线程端口扫描软件
- python 进行多线程编程,使用Semaphore控制线程数
- 使用Python多线程抓取并验证代理
- Python多线程 简明例子
- python多线程
- Python多线程使用2009-12-30
- python 多线程时,urllib2的古怪问题
- Python中socket和多线程的应用
- python 多线程
- 发一个python写的多线程 代理服务器 抓取,保存,验证程序,希望喜欢python的朋友和我一起完善它
- C++多线程中调用python api函数
- python多线程例子2
- Python里的多线程
- C++多线程中调用python api函数
- python 多线程 XML RPC的实现
- C++多线程中调用python api函数
- C++多线程中调用python api函数
- python多线程
- 07-爬虫的多线程调度 | 01.数据抓取 | Python
- python 多线程