tôi có thể thiếu một cái gì đó ngớ ngẩn, nhưng ive chạy mã của tôi trong PythonWin và nó hoạt động, nhưng khi tôi chạy nó trong dòng lệnh nó freakspython sẽ không tạo chuỗi?
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
Một điều bạn có thể muốn biết là 'import pdb; pdb.pm()' sẽ mở trình gỡ lỗi tại điểm ngoại lệ cuối cùng. – Marcin