gpt4 book ai didi

python - Python Sched 中的问题

转载 作者:行者123 更新时间:2023-11-30 23:55:34 25 4
gpt4 key购买 nike

我已经在 Windows 中使用 python 创建了在后台运行的调度程序的数量。谁能告诉我任何命令来检查 Windows 上运行的调度程序数量以及如何删除它们?

最佳答案

如果您使用sched.scheduler,则可以查询sched.scheduler.queue

scheduler.queue

Read-only attribute returning a list of upcoming events in the order they will be run. Each event is shown as a named tuple with the following fields: time, priority, action, argument.

就在 docs还有这个小建议:

In multi-threaded environments, the scheduler class has limitations with respect to thread-safety, inability to insert a new task before the one currently pending in a running scheduler, and holding up the main thread until the event queue is empty. Instead, the preferred approach is to use the threading.Timer class instead.

关于python - Python Sched 中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4585237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com