![](/img/trans.png)
[英]How can I calculate the number of sun hours for a given day and location, considering nearby mountains (with Python)?
[英]In Python, how can I set a reminder on a given day?
我正在制作一个用于启动其他程序的Python程序,但我想添加一个功能,例如,如果该程序在周三使用,它可能会说'拿起孩子'或者类似的提醒
请参阅datetime.date以了解时间和时区无关紧要的日期。
为了便于阅读,我会使用:
import datetime
if datetime.date.today().strftime('%A') == 'Wednesday':
print("Pick up the kids!")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.