Kill Thread
只有一个功能,杀死线程!
安装
pip install kill-thread
示例
import time
import datetime
import threading
from kill_thread import kill_thread
def print_time():
while True:
time.sleep(1)
print(datetime.datetime.now())
# 生成启动一个每隔一秒打印当前时间的线程
thread = threading.Thread(target=print_time)
thread.start()
# 十秒后杀死线程
time.sleep(10)
kill_thread(thread)
# 阻塞主线程观察打印时间的线程是否被杀死
input('按任意键终止主线程')
Metadata
Release files for kill-thread 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kill-thread-0.0.1.tar.gz | 6.2 kB | Without provenance | Details for kill-thread-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kill_thread-0.0.1-py3.9.egg | Legacy Egg format | - | - | Details for kill_thread-0.0.1-py3.9.egg |
Total release size: 8.4 kB
Release files / kill-thread-0.0.1.tar.gz
| Download URL | kill-thread-0.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98dc45a75b91c10009787ae4ac3b0f047b17a00d65b93aaf58fce9fcf5b0b099
|
|
BLAKE2b-256 checksum How to use checksums |
71e16f514431582fc045dbcea8d3ffae2c5de86e6a82eb3ec9aba940bdfff5a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.9
|
Release files / kill_thread-0.0.1-py3.9.egg
| Download URL | kill_thread-0.0.1-py3.9.egg |
|---|---|
| Size | 2.2 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
b56e22ff058747a4c75df658966eaa6af5fba44f81b279c973939c00e289d185
|
|
BLAKE2b-256 checksum How to use checksums |
edae79271f503fbc3d3acac3052828695a8102911fbb0a5631b489d61664b403
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.9
|
Security for kill-thread 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.