Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("rv --->", type(rv)) # <class 'ValueResult'> returned from database
- print("rv.value --->", type(rv.value)) # <class 'dict'>
- # shows {'ACTION_CODE': 'S', 'ARRIVAL_DATE': '03-JUL-19', 'BIT_FLAGS': '1082131456'
- print(rv.value)
- print("rv.value.items() ---> ", type(rv.value.items())) #<class 'dict_items'>
- print(json.loads(json.dumps(rv.value))) # used this no help
- [
- {"ACTION_CODE": "S"},
- {"ARRIVAL_DATE": "03-JUL-19"} ,
- {"BIT_FLAGS": "1082131456" }
- ]
- a={'ACTION_CODE': 'S', 'ARRIVAL_DATE': '03-JUL-19', 'BIT_FLAGS': '1082131456'}
- print([ {key:value} for key,value in a.items()])
- [{'ACTION_CODE': 'S'}, {'ARRIVAL_DATE': '03-JUL-19'}, {'BIT_FLAGS': '1082131456'}]
- x ={'ACTION_CODE': 'S', 'ARRIVAL_DATE': '03-JUL-19', 'BIT_FLAGS': '1082131456'}
- [{list(x.keys())[i]:list(x.values())[i]} for i in range(len(x))]
- [{'ACTION_CODE': 'S'},
- {'ARRIVAL_DATE': '03-JUL-19'},
- {'BIT_FLAGS': '1082131456'}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement