I have a dictionary
a = {\'ground\': obj1, \'floor 1\': obj2, \'basement\': obj3}
I have a list.
a_list = [\'floor 1\', \'grou
You could just retrieve the values in order of the keys provided by the list and make a new list out of the key-value pairs.
Example:
d = a # dictionary containing key-value pairs that are to be ordered
l = a_list # list of keys that represent the order for the dictionary
# retrieve the values in order and build a list of ordered key-value pairs
ordered_dict_items = [(k,d[k]) for k in l]