Skip to main content

Countdown

python第三方库,实现到达目标时间执行函数

安装

pip isntall FuyaoCountdown

使用

from FuyaoCountdown.countdown import Countdown


def job():
    print("job is running")


if __name__ == '__main__':
    cd = Countdown("2025-09-16", 5, 20)

    cd.threadExecutor(True, job)

参数说明

Countdown(
    date: str 日期,如 "2025-09-16",
    hour: int 小时,如 5
    minute: int 分钟,如 20
    second: int 秒,如 0
    nextTime: bool 当前目标时间到达后是否继续进行倒计时任务(明天的目标时间)
)

Countdown.threadExecutor(
    useThread: bool 是否启用新线程
    job: Callable[..., Any]  可调用的任意对象/函数(任务对象)
    jobArgs: tuple  任务对象所需的参数
)

项目结构

Countdown  项目名
    src  源代码
        FuyaoCountdown  软件包
    pyproject.toml  打包信息
    README.md  说明文件
    

更新日志

v0.0.1

1.支持新线程执行任务

v0.0.2

修复bug: 1.修复函数传参少的问题 2.修复传入datetime.date类型数据无法解析的问题 3.修复控制台输出不换行的问题

更新: 1.添加对执行到下一个目标时间的可选参数

Metadata

Release files for FuyaoCountdown 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FuyaoCountdown 0.0.2
File Size Uploaded
fuyaocountdown-0.0.2.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FuyaoCountdown 0.0.2
File Interpreter ABI Platform
fuyaocountdown-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / fuyaocountdown-0.0.2.tar.gz

Download URL fuyaocountdown-0.0.2.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3685dddc59c643712b9dc9105d95a6263101ec7ede4b34fd83e83e8f2fb03e99
BLAKE2b-256 checksum
How to use checksums
51528e9b24f2a315eb38a6d44ebe392d09c9735522a0e241b332497004dc38c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

Release files / fuyaocountdown-0.0.2-py3-none-any.whl

Download URL fuyaocountdown-0.0.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00019b91f764ffcfb62397b2ab5fd22354ba962e5bd35fc9ec95da910bee2c83
BLAKE2b-256 checksum
How to use checksums
91e4437954898c61a7c22c988a85f727d595ebf8f07a713ce065f42c9852aa73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page