A package that allows to cancel, certain functions that can be a pain, when working with threading.
Project description
Usage
Without the normal time package:
from cancelable import time
import threading
def count():
i = 1
while True:
time.sleep(1)
print(i)
i += 1
threading._start_new_thread(count, ())
input("Click enter to cancel counting\n")
time.cancel()
With the normal time package:
from cancelable import time as cancelableTime
import threading
def count():
i = 1
while True:
cancelableTime.sleep(1)
print(i)
i += 1
threading._start_new_thread(count, ())
input("Click enter to cancel counting\n")
cancelableTime.cancel()
To do
Add more functions such as input()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cancelable-py-0.0.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for cancelable_py-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f33d58ac0e080d7bd492839218f02c7e1bb178fd61b413753488d750ca06c725 |
|
MD5 | 718adb5d0fa6dba14c776667fa4baf80 |
|
BLAKE2b-256 | 6089c78486e38b1575cd97016949bcf23f3e8319a18c33959de62b93f2001834 |