Killable threads in Python!
Project description
kthread
Killable threads in Python!
Installation
To install this package, run the following command:
$ pip install kthread
Usage
>>> import time
>>> import kthread
>>> def func():
>>> try:
>>> while True:
>>> time.sleep(0.2)
>>> finally:
>>> print "Greetings from Vice City!"
>>>
>>> t = kthread.KThread(target = func, name = "KillableThread1")
>>> t.start()
>>> t.isAlive()
True
>>> t.terminate()
Greetings from Vice City!
>>> t.isAlive()
False
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
kthread-0.2.tar.gz
(2.2 kB
view hashes)
Built Distribution
kthread-0.2-py2-none-any.whl
(3.3 kB
view hashes)