div {
position: relative;
width: 100px;
height: 50px;
border-width: 3px 3px 0 3px;
border-color: #f00 #f00 transparent #f00;
border-style: solid;
background: linear-gradient(to right, #f00 0, #f00 40px, transparent 41px, transparent 59px, #f00 60px, #f00 100%) no-repeat bottom center / 100% 3px;
}
div:after {
content: "";
position: absolute;
display: block;
bottom:-9px;
left: 41px;
width: 14px;
height: 14px;
transform: rotate(-45deg);
border-bottom: 3px solid #f00;
border-left: 3px solid #f00;
}
import datetime
import json
in_data = {}
in_data['2018']={'11': ['3', '4', '5', '10', '11', '17', '18', '24', '25'],
'10': ['6', '7', '13', '14', '20', '21', '27', '28'],
'12': ['1', '2', '8', '9', '15', '16', '22', '23', '29', '30', '31*'],
'1': ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '13', '14', '20', '21', '27', '28'],
'3': ['3', '4', '7*', '8', '10', '11', '17', '18', '24', '25', '31'],
'2': ['3', '4', '10', '11', '17', '18', '22*', '23', '24', '25'],
'5': ['1', '5', '6', '8*', '9', '12', '13', '19', '20', '26', '27'],
'4': ['1', '7', '8', '14', '15', '21', '22', '28', '29', '30*'],
'7': ['1', '7', '8', '14', '15', '21', '22', '28', '29'],
'6': ['2', '3', '9', '10', '11*', '12', '16', '17', '23', '24', '30'],
'9': ['1', '2', '8', '9', '15', '16', '22', '23', '29', '30'],
'8': ['4', '5', '11', '12', '18', '19', '25', '26']}
print(json.dumps(dict([[year,
dict([[month,
dict([[day,
{'isWorking':2}] for day in in_data[year][month]])
] for month in in_data[year]]
)] for x in in_data]
), indent=4, sort_keys=4
))
{
"2018": {
"1": {
"1": {
"isWorking": 2
},
"10": {
"isWorking": 2
},
"13": {
"isWorking": 2
},
"14": {
"isWorking": 2
},
"2": {
"isWorking": 2
},
"20": {
"isWorking": 2
},
"21": {
"isWorking": 2
},
"27": {
"isWorking": 2
},
"28": {
"isWorking": 2
},
"3": {
"isWorking": 2
},
"4": {
"isWorking": 2
},
"5": {
"isWorking": 2
},
"6": {
"isWorking": 2
},
"7": {
"isWorking": 2
},
"8": {
"isWorking": 2
},
"9": {
"isWorking": 2
}
},
"10": {
"13": {
"isWorking": 2
},
"14": {
"isWorking": 2
},
"20": {
"isWorking": 2
},
"21": {
"isWorking": 2
},
"27": {
"isWorking": 2
},
"28": {
"isWorking": 2
},
"6": {
"isWorking": 2
},
"7": {
"isWorking": 2
}
},
"11": {
"10": {
"isWorking": 2
},
"11": {
"isWorking": 2
},
"17": {
"isWorking": 2
},
"18": {
"isWorking": 2
},
"24": {
"isWorking": 2
},
"25": {
"isWorking": 2
},
"3": {
"isWorking": 2
},
"4": {
"isWorking": 2
},
"5": {
"isWorking": 2
}
},
"12": {
"1": {
"isWorking": 2
},
"15": {
"isWorking": 2
},
"16": {
"isWorking": 2
},
"2": {
"isWorking": 2
},
"22": {
"isWorking": 2
},
"23": {
"isWorking": 2
},
"29": {
"isWorking": 2
},
"30": {
"isWorking": 2
},
"31*": {
"isWorking": 2
},
"8": {
"isWorking": 2
},
"9": {
"isWorking": 2
}
},
"2": {
"10": {
"isWorking": 2
},
"11": {
"isWorking": 2
},
"17": {
"isWorking": 2
},
"18": {
"isWorking": 2
},
"22*": {
"isWorking": 2
},
"23": {
"isWorking": 2
},
"24": {
"isWorking": 2
},
"25": {
"isWorking": 2
},
"3": {
"isWorking": 2
},
"4": {
"isWorking": 2
}
},
"3": {
"10": {
"isWorking": 2
},
"11": {
"isWorking": 2
},
"17": {
"isWorking": 2
},
"18": {
"isWorking": 2
},
"24": {
"isWorking": 2
},
"25": {
"isWorking": 2
},
"3": {
"isWorking": 2
},
"31": {
"isWorking": 2
},
"4": {
"isWorking": 2
},
"7*": {
"isWorking": 2
},
"8": {
"isWorking": 2
}
},
"4": {
"1": {
"isWorking": 2
},
"14": {
"isWorking": 2
},
"15": {
"isWorking": 2
},
"21": {
"isWorking": 2
},
"22": {
"isWorking": 2
},
"28": {
"isWorking": 2
},
"29": {
"isWorking": 2
},
"30*": {
"isWorking": 2
},
"7": {
"isWorking": 2
},
"8": {
"isWorking": 2
}
},
"5": {
"1": {
"isWorking": 2
},
"12": {
"isWorking": 2
},
"13": {
"isWorking": 2
},
"19": {
"isWorking": 2
},
"20": {
"isWorking": 2
},
"26": {
"isWorking": 2
},
"27": {
"isWorking": 2
},
"5": {
"isWorking": 2
},
"6": {
"isWorking": 2
},
"8*": {
"isWorking": 2
},
"9": {
"isWorking": 2
}
},
"6": {
"10": {
"isWorking": 2
},
"11*": {
"isWorking": 2
},
"12": {
"isWorking": 2
},
"16": {
"isWorking": 2
},
"17": {
"isWorking": 2
},
"2": {
"isWorking": 2
},
"23": {
"isWorking": 2
},
"24": {
"isWorking": 2
},
"3": {
"isWorking": 2
},
"30": {
"isWorking": 2
},
"9": {
"isWorking": 2
}
},
"7": {
"1": {
"isWorking": 2
},
"14": {
"isWorking": 2
},
"15": {
"isWorking": 2
},
"21": {
"isWorking": 2
},
"22": {
"isWorking": 2
},
"28": {
"isWorking": 2
},
"29": {
"isWorking": 2
},
"7": {
"isWorking": 2
},
"8": {
"isWorking": 2
}
},
"8": {
"11": {
"isWorking": 2
},
"12": {
"isWorking": 2
},
"18": {
"isWorking": 2
},
"19": {
"isWorking": 2
},
"25": {
"isWorking": 2
},
"26": {
"isWorking": 2
},
"4": {
"isWorking": 2
},
"5": {
"isWorking": 2
}
},
"9": {
"1": {
"isWorking": 2
},
"15": {
"isWorking": 2
},
"16": {
"isWorking": 2
},
"2": {
"isWorking": 2
},
"22": {
"isWorking": 2
},
"23": {
"isWorking": 2
},
"29": {
"isWorking": 2
},
"30": {
"isWorking": 2
},
"8": {
"isWorking": 2
},
"9": {
"isWorking": 2
}
}
}
}
{1999: {
1: {1,2,3,4,6,7,9,10,16,17,23,24,30,31},
2:{6,7,13,14,20,21,27,28},
3: {6,7,8,13,14,20,21,27,28},
.... }
2000: {
1: .....
12: ...}
...
}
if day in dict[year][month]:
print("Рабочий день")
else:
print("Нерабочий день")
import csv
holiday = input ()
with open('file.csv') as f:
readCSV = csv.reader(f, delimeter=',')
for row in readCSV:
if holiday == row[0]:
print('ok')
import csv
year = input()
mont = input()
day = input()
with open('33.csv', encoding='utf-8') as f:
readCSV = csv.reader(f, delimiter=',')
for row in readCSV:
if year == row[0]:
months = row[1:12]
i = int(int(mont) - 1)
if day or day+"*" not in months[i]:
print("Выходной")
else:
print("Рабочий")
import csv
csv_iter = csv.reader(file('temp.csv'))
next(csv_iter)
for row in csv_iter:
print row