判断工作日与休息日(中国)代码,不需要再手动创建 excel 了
import datetime
from chinese_calendar import is_workday
today = ‘2020-10-01’
date = datetime.datetime.strptime(today,‘%Y-%m-%d’)
if is_workday(date):
print(“{} 是工作日”.format(date))
else:
print(“{} 是休息日”.format(date))
"import datetime from chinese_calendar import is_workday today = ‘2020-10-01’ date = datetime.datetime.strptime(today,‘%Y ...."
import datetime
from chinese_calendar import is_workday
today = ‘2020-10-01’
date = datetime.datetime.strptime(today,‘%Y-%m-%d’)
if is_workday(date):
print(“{} 是工作日”.format(date))
else:
print(“{} 是休息日”.format(date))
👍