terminate_thread
Project description
import threading
import time
from terminate_thread import terminate, kill
def thread_func1():
n = 0
while True:
n += 1
print(n, t)
time.sleep(1)
if __name__ == "__main__":
t = threading.Thread(target=thread_func1, )
t.start()
time.sleep(2)
terminate(t)
# or
kill(t)
exit(0)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
terminate_thread-0.0.2.tar.gz
(8.9 kB
view hashes)
Built Distribution
Close
Hashes for terminate_thread-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0a4f2947a3c0fb14ae0d4461134915503e8a4814b551426fb00db7bf14e7c6c |
|
MD5 | f60727cc37d92904d9fe1ddc25fb9a93 |
|
BLAKE2b-256 | 130b9ea23cfc7f9681a51c598638cceafbe74740247dfab36be0b8d9597bcbc9 |