擅长:python、mysql、java
<p>APScheduler可能就是你想要的。</p>
<pre><code>from datetime import date
from apscheduler.scheduler import Scheduler
# Start the scheduler
sched = Scheduler()
sched.start()
# Define the function that is to be executed
def my_job(text):
print text
# The job will be executed on November 6th, 2009
exec_date = date(2009, 11, 6)
# Store the job in a variable in case we want to cancel it
job = sched.add_date_job(my_job, exec_date, ['text'])
# The job will be executed on November 6th, 2009 at 16:30:05
job = sched.add_date_job(my_job, datetime(2009, 11, 6, 16, 30, 5), ['text'])
</code></pre>
<p><a href="https://apscheduler.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://apscheduler.readthedocs.io/en/latest/</a></p>
<p>您可以将它构建到您正在调度的函数中,让它安排另一次运行。</p>