Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- res = []
- people = ['xx', 'xx', 'xx']
- datedb = {"201905":{"18":"2","19":"1","25":"1","26":"1"},"201906":{"01":"2","02":"2","07":"2","08":"2","09":"1","15":"2","16":"2","22":"1","23":"1","29":"1","30":"1"},"201907":{"06":"2","07":"2","13":"2","14":"2","20":"1","21":"2","27":"1","28":"1"},"201908":{"03":"2","04":"2","10":"2","11":"2","17":"1","18":"1","24":"1","25":"2","31":"1"},"201909":{"01":"1","07":"2","08":"1","13":"2","14":"2","15":"2","21":"2","22":"2","28":"1"},"201910":{"01":"2","02":"2","03":"2","04":"1","05":"1","06":"1","07":"2","13":"1","19":"1","20":"1","26":"1","27":"2"},"201911":{"02":"2","03":"2","09":"2","10":"1","16":"2","17":"2","23":"1","24":"1","30":"1"},"201912":{"01":"1","07":"2","08":"2","14":"2","15":"2","21":"1","22":"1","28":"2","29":"1"}}
- for m in datedb:
- for d in datedb[m]:
- date = m + d
- res.append(date)
- print(date)
- check = []
- out = []
- for item in res:
- tmp = {}
- for j in people:
- if len(check) == 3:
- check = []
- if j not in check:
- check.append(j)
- tmp['date'] = item
- tmp['name'] = j
- break
- out.append(tmp)
- print (out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement