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.3.tar.gz
(9.0 kB
view hashes)
Built Distribution
Close
Hashes for terminate_thread-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d4604d68ba2a7dba0a323f494015355a284014aaac72d13049fb7321a31b60 |
|
MD5 | 0fda75b72550321cbf62e1c4353e5c15 |
|
BLAKE2b-256 | 3ff9980e4be6158ca49bc3f3304afcdc4b15c2970975593b9b28a36d49edc769 |