Skip to main content

常用小工具

Project description

个人小工具集

时间类

定时器

from metools import timer_decorator


# 每2秒执行一次,只执行3次
@timer_decorator(interval=2.0, repeat=3)
def limited_task():
    print("定时任务执行中!")


# 每1.5秒执行一次,无限重复
@timer_decorator(interval=1.5)
def infinite_task():
    print("无限任务")


# 启动定时器并获取停止事件
stop_event = infinite_task()

# 在需要时停止定时任务
stop_event.set()  # 这将停止定时器

许可证

MIT License

Copyright (c) [2025] [111hgx]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

metools-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metools-0.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file metools-0.0.1.tar.gz.

File metadata

  • Download URL: metools-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for metools-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a43408b52fa0b650975e705c483d5f47dc3f3057919999546ece2f4d49871e38
MD5 ec5c628b7861330fc1597c6d21964e96
BLAKE2b-256 9fc1bfb4ec171ed4c9e7d927fc69fb6ba87d7b44b15fd93cc8ea7e095b251853

See more details on using hashes here.

File details

Details for the file metools-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: metools-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for metools-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e35cc3ef2a3af3a19a4d1160b14d5c01ccb324b761dd7dc29240eac96330f4d
MD5 04bc9b520017008786db4a15cedec2b5
BLAKE2b-256 098d5b0752885f7c77c160199fe6bc4c3b83669ff4d3713068834069b32328d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page