【发布时间】:2012-02-02 15:20:26
【问题描述】:
我可能遗漏了一些愚蠢的东西,但是我在 pythonwin 中运行了我的代码并且它可以工作,但是当我在命令行中运行它时它会发疯
import time, thread
def print_t(name, delay):
while 1:
time.sleep(delay)
print name
try:
thread.start_new_thread(print_t,("First Message",1,))
thread.start_new_thread(print_t,("Second Message",2,))
except Exception as e:
print e
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 pdb;pdb.pm()将在最后一个异常点打开调试器。
标签: python windows multithreading