内容比较短,直奔主题吧
week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
today = week.index(datetime.datetime.now().strftime('%A'))
print(today)
week是日期的字符串数组
today是读取今天系统时间的返回值,即可获得今天的星期
内容比较短,直奔主题吧
week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
today = week.index(datetime.datetime.now().strftime('%A'))
print(today)
week是日期的字符串数组
today是读取今天系统时间的返回值,即可获得今天的星期