Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{u'month': u'7', u'stay_days': {u'value': 1.0}},
- {u'month': u'8', u'stay_days': {u'value': 1.0}},
- {u'month': u'9', u'stay_days': {u'value': 1.0}}]
- arr = '''[ {
- "stay_days": {
- "value": 1.0
- },
- "month": "1"
- },
- {
- "stay_days": {
- "value": 1.0
- },
- "month": "2"
- },
- {
- "stay_days": {
- "value": 1.0
- },
- "month": "3"
- }]'''
- json_object = json.loads(arr)
- dt = datetime.strptime(datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f'), "%Y-%m-%dT%H:%M:%S.%f")
- month = dt.month
- months = []
- for line in json_object:
- months.append(line["key"])
- months
- if (int(month) - int(max(months))) > 0 and (int(month) - int(max(months))) <= 3:
- for line in json_object:
- # ???
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement