我正在编写一个简单的函数,它使用 AsyncIOScheduler 根据计划发送消息。
scheduler = AsyncIOScheduler()
scheduler.add_job(job, "cron", day_of_week="mon-fri", hour = "16")
scheduler.start()
Run Code Online (Sandbox Code Playgroud)
它似乎有效,但我总是收到以下消息:
PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495)
Run Code Online (Sandbox Code Playgroud)
我根本不熟悉 python 中的时间,所以我不太确定这条消息要求我做什么。我访问了消息中提供的链接,但那里的解释对我来说太复杂了。据我了解,我必须迁移到使用 PEP495,但我到底该怎么做呢?