Time_Manager. [v1.8]
Improves work with time.
# Time Manager.
from pytime_manager import *
from pytime_manager.uc import *
# Translate one year into days.
print(translate_time(1, YEAR, DAY)) # => 365
# Or...
print(translate_time_y(1, DAY)) # => 365
# Make sure to add this line so everything will work!
set_translate_time(translate_time) # translate_time is located in time_manager.uc.
# Print 'Hello!' after three seconds.
time_thread(
call_after(
lambda: print('Hello!'),
3 # or Delay((3, SECOND))
)
)
# Print 'Hello!' and after three seconds print 'Bye!'.
time_thread(
call_after2(
lambda: print('Hello!'),
lambda: print('Bye!'),
3 # or Delay((3, SECOND))
)
)
# Print message for three seconds.
time_thread(
do_for(
lambda: print('Print me for three seconds.'),
3 # or Delay((3, SECOND))
)
)
# Print message three times with one second delay.
time_thread(
do(
lambda: print('print me 3 times with one second delay'), 1, 3
)
)
# Print message and wait three seconds.
do_and_wait(lambda: print('Hi!'), 3)
# Blocking Time Thread VS Time Thread.
blocking_time_thread(do(lambda: print('Hello 1'), 1, 5)) # Uses virtual 'main' thread.
print('Application thread is unblocked but still unable to call blocking another time thread.')
blocking_time_thread(do(lambda: print('Hello 2 (Not going to print because its blocked for me)'), 1, 5)) # Uses virtual 'main' thread.
blocking_time_thread(do(lambda: print('Hello 3 (I\'m from another thread so I don\'t care.)'), 1, 5), thread='other_thread') # Uses virtual 'other_thread' thread.
time_thread(do(lambda: print('I\'m going to be printed because i\'m free time thread.'), 1, 5))
# Schedule function calling.
time_thread(
do_every(
lambda: print('Hello!'),
Delay((1, MINUTE), (30, SECOND), (2.5, SECOND)), # 1min 32.5s (92.5s) [example: [(1, DAY), (12, HOUR)] => 1 day, 12 hours] : OR : 60 + 30 + 2.5 = 32.5s (32.5 [float]).
False # Once?
)
)
# Do some things while blocked.
time_thread(do_while_blocked(lambda: print('Blocked!'), lambda: wait(3)))
Adds more than 15 functions to improve work with time, and a lot more things.
Metadata
Release files for pytime-manager 1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytime_manager-1.8.tar.gz | 5.7 kB | Without provenance | Details for pytime_manager-1.8.tar.gz |
Release files / pytime_manager-1.8.tar.gz
| Download URL | pytime_manager-1.8.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e418f802ef67bc97a1fe9a26349ff4ca091fca9685bcfa3e8652d600b8d454d0
|
|
BLAKE2b-256 checksum How to use checksums |
5fb70ca3bc149533c0e60779671621840de65ad5773ae0ca0f60e20f245af1dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.9
|
Security for pytime-manager 1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.