Skip to main content

terminate_thread

Project description

import threading
import time
from terminate_thread import terminate


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)
    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.1.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

terminate_thread-0.0.1-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

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