私は愚かな何かが欠けていることかもしれないが、IVEはpythonwinに私のコードを実行し、それが動作しますが、私は、コマンドラインでそれを実行すると、それは時にメインスレッド(起動する1pythonはスレッドを作成しませんか?
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()'が最後の例外の時点でデバッガを開くことです。 – Marcin