> 动物
pytho怎么根据日期得到星期(pytho计算给定的日期的星期)
导语:python 日期的星期
import datetimedef get_week_day(date): week_cn = {1: &39;, 2: &39;, 3: &39;, 4: &39;, 5: &39;, 6: &39;, 7: &39;} return week_cn[date.weekday()+1]if __name__ == &39;: now = datetime.datetime.now() print(now) print(get_week_day(now))
本文内容由快快网络小冰创作整理编辑!