Installation
pip install cancelable-py
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()
Metadata
Release files for cancelable-py 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cancelable-py-0.0.2.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cancelable_py-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / cancelable-py-0.0.2.tar.gz
| Download URL | cancelable-py-0.0.2.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc8ae492605f9696f0cb3a3485620cd03ee52511d65901dcf0db9d05d24d9b32
|
|
BLAKE2b-256 checksum How to use checksums |
88aa36bb9bd61bb5236a8c16c66b06a3d800607002c477a7971e7e7bb912c448
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.7
|
Release files / cancelable_py-0.0.2-py3-none-any.whl
| Download URL | cancelable_py-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a75915c2bc5f98d470e58d951f9c99c46ba1d69ec1aba7bd21e740937e14d86e
|
|
BLAKE2b-256 checksum How to use checksums |
a8f19496dba1c414e17845f0d14567ce260324d311322ddbcc13fb50ee1e38ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.7
|