Skip to main content

Python thread control, using ctypes to achieve forcibly terminating a thread even if it is still running.

Project description

tdmgm

python线程控制,使用ctypes实现即时线程还在运行中,也可以强行终止线程运行。

特性

  • 线程控制工具类
  • 支持循环线程和一次性线程
  • 便捷的线程管理与结果获取

安装

推荐使用 pip 安装:

pip install tdmgm

或直接在本地项目中使用:

git clone https://github.com/zaixia108/ThreadControl.git
cd ThreadControl
pip install .

目录结构

tdmgm/
├── __init__.py
├── CycleThread.py
├── OnceThread.py
├── thread_utils.py

快速上手

from tdmgm.CycleThread import CycleThread
from tdmgm.OnceThread import OnceThread

def my_task():
    print("线程任务执行中")

# 循环线程示例
cycle = CycleThread(target=my_task, name="循环线程")
cycle.start()

# 一次性线程示例
once = OnceThread(target=my_task, name="一次性线程")
once.start()

许可证

MIT License

作者

zaixia108
邮箱: xvbowen2012@gmail.com

项目主页

https://github.com/zaixia108/ThreadControl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdmgm-1.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tdmgm-1.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file tdmgm-1.1.0.tar.gz.

File metadata

  • Download URL: tdmgm-1.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for tdmgm-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1a39944f67fff25d3d1e4400d1384c50e81f16f464998252c997dbc72f36e505
MD5 e5db0f769ed7a455124c57ef7da0c9f2
BLAKE2b-256 acaacbb834dcd6b5d6248305c0555889baf98c6115f816d1c0016e2a348c11f0

See more details on using hashes here.

File details

Details for the file tdmgm-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tdmgm-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for tdmgm-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85d3b8d15d6cf7b81e9d94886e47a2e7597b4cbb69a987b458f6da6ba1aa024a
MD5 108b462ac2e8da762d2cc129f7b82e92
BLAKE2b-256 a191ad87d21cd20dc738b011c7185860686356dc9f118d39aefcc83971566014

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page