[D]python运行多线程出现错误
IDLE's subprocess didn't make connection.Either IDLE can;t start a subprocess or personal firewall software is blocking the connection
我就是按照书上写一个多线程的小程序,代码如下
- Python code
import threadingimport timeclass ThreadDemo(threading.Thread): def __init__(self,index,create_time): threading.Thread.__init__(self) self.index=index self.create_time=create_time def run(self): time.sleep(1) print((time.time()-self.create_time),"\t",self.index) print("Thread %d exit"% (self.index))for index in range(5): thread=ThreadDemo(index,time.time()) thread.start()print("Main Thread exit...")
我也谷歌和百度了,那些修改Python27\Lib\idlelib中的pyshell.py或者run.py文件的方法都试过了,不行。
我用的是python for window 2.7 的idle
是不是本身idle就不支持多线程。问一下各位大大的多线程程序都怎么运行的
-------------------------------
Double行动:
原帖分数:20
加分:20
[解决办法]
用eclipse跑的没问题啊。。
[解决办法]
我也遇过,不过就如错误所述,是杀软的防火墙自动强了idle,你的代码嘛还没测试...