擅长:python、mysql、java
<p>如果我没弄错你的问题,模块<a href="https://github.com/dbader/schedule" rel="nofollow noreferrer">schedule</a>可能就是你要找的。在</p>
<p><a href="https://stackoverflow.com/questions/373335/how-do-i-get-a-cron-like-scheduler-in-python">How do I get a Cron like scheduler in Python?</a></p>
<pre><code>import schedule
import time
def job():
print("I'm working...")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
while 1:
schedule.run_pending()
time.sleep(1)
</code></pre>