Skip to main content

bode's private time model.

Project description

bode’s time model.

安装

  • pip install bdtime

案例

from bd_time import Time()
tt = Time()
tt.now(1)  # 输出当前运行的时间
tt.during(10)  # 检测运行时间是否在10秒内
tt.get_key_state('a')  # 检测'a'键是否按下
tt.stop('alt + a')      # 如果按下[Alt + a]键就推出

# 测试函数用, [2秒后]运行函数
@tt.run_f_with_sleep(2)
def f():
    ret = 'haha'
    return ret
print(f())

# 测试函数用, [5秒内]循环运行函数, 运行间隔为[1秒]
@tt.run_f_with_during((during_time=5, sleep_time=1)
def f():
    return keyboard.is_pressed('a') #-> True
f()

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

bdtime-1.0.6.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

bdtime-1.0.6-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file bdtime-1.0.6.tar.gz.

File metadata

  • Download URL: bdtime-1.0.6.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.12

File hashes

Hashes for bdtime-1.0.6.tar.gz
Algorithm Hash digest
SHA256 500ee40db31af1425829792cf642740f704f2370d97a8c827b4ac639dcdab9fd
MD5 4d92e1f5ea34f44435f7db73676e2331
BLAKE2b-256 1eb4fb9679196ac26f1f534c22e16f9b35b4012f47c9909ebc884310f3c35346

See more details on using hashes here.

File details

Details for the file bdtime-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: bdtime-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.12

File hashes

Hashes for bdtime-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 49dcd419e3df77915223dcacd88f63273db7a3f12f3c12837e1d129c95d58c45
MD5 46a7e49b47690337dab347d42c6fc9df
BLAKE2b-256 d4245345531d48ce84e77f0709ada222288a8c922a3e75e8bfdbb944fa666349

See more details on using hashes here.

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