I have a list containing multiple dictionaries. Each Dictionary will have a date and time Key. What I am trying to figure out is how print the values of each dictionary to a line in chronological order.
Below is an example of my code.
list_of_dicts = []
dict1 = {'Source': 'Log1', 'Type': 'Connection', 'Datetime': '2014-02-13 14:10:00', 'fullpath':'N/A'}
dict2 = {'Source': 'Log2', 'Type': 'Disconnect', 'Datetime': '2014-05-13 11:00:00', 'fullpath':'N/A'}
dict3 = {'Source': 'Log4', 'Type': 'Other', 'Datetime': '2014-05-10 02:50:00', 'fullpath':'N/A'}
list_of_dicts.append(dict1)
list_of_dicts.append(dict2)
list_of_dicts.append(dict3)
The expected output would look like this:
Datetime Source Type Fullpath
2014-02-13 14:10:00 Log1 Connection N/A
2014-05-10 02:50:00 Log4 Other N/A
2014-05-13 11:00:00 Log2 Disconnect N/A
I would greatly appreciate anyone's guidance on this. Thanks so much.