Skip to main content

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


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.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

terminate_thread-0.0.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file terminate_thread-0.0.4.tar.gz.

File metadata

  • Download URL: terminate_thread-0.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for terminate_thread-0.0.4.tar.gz
Algorithm Hash digest
SHA256 30366577ec60116bcfd1bedc012f126fd505614fbfdc77c6be0469009efa5b93
MD5 d3e226153cd35ee1cc9855d6a0000533
BLAKE2b-256 f8ab8ff6bbdad8a2020d2b59c29520d40ef58a92b51579010b16f0b10fc8201f

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminate_thread-0.0.4.tar.gz:

Publisher: new-python-publish.yml on calm51/terminate_thread

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terminate_thread-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for terminate_thread-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8f72e93fb35cf468769566ac4af3493b5ef501f5741d22ec260feec3607d901e
MD5 217c7b7cdeec38bb0e70dbcbd9dc3c39
BLAKE2b-256 526222b3fc8ad0266aaacd73851bfa545b3cbbaf2db4aa2bd29702aa3ab728c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminate_thread-0.0.4-py3-none-any.whl:

Publisher: new-python-publish.yml on calm51/terminate_thread

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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