Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何杀死以thread.start\u new\u thread启动的线程_Windows_Multithreading_Python 2.7 - Fatal编程技术网

Windows 如何杀死以thread.start\u new\u thread启动的线程

Windows 如何杀死以thread.start\u new\u thread启动的线程,windows,multithreading,python-2.7,Windows,Multithreading,Python 2.7,如何杀死以thread.start\u new\u thread启动的线程?谢谢大家! import thread def test_thread(): for i in range(100): sleep(1) print('time %r' % time()) print('%r' % 'thread is done') thread.start_new_thread(test_thread,()) 是我的问题的解决方案,线程可以根据需要暂停

如何杀死以thread.start\u new\u thread启动的线程?谢谢大家!

import thread

def test_thread():
    for i in range(100):
       sleep(1)
       print('time %r' % time())
    print('%r' % 'thread is done')

thread.start_new_thread(test_thread,())

是我的问题的解决方案,线程可以根据需要暂停和恢复。

我想杀死它,而不是暂停或恢复