求助:pydev的问题
刚学python,用pydev写一个测试多线程的小程序,代码如下:
复制代码
在IDLE下运行正常,用pydev直接运行,提示如下错误:
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
求教解决方法
- import thread
-
- def run(n):
- print n
-
- def test():
- thread.start_new_thread(run,(1,))
- thread.start_new_thread(run,(2,))
-
- if __name__=='__main__':
- test()
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
求教解决方法
作者: 0xC1988 发布时间: 2011-05-30
回复 0xC1988
复制代码
thread模块已经不推荐使用了,考虑使用threading模块。
- if __name__=='__main__':
- test()
- time.sleep(10)
作者: 106033177 发布时间: 2011-05-30