import json
def read_json(filename):
dt = {}
fh = open(filename, "r")
dt = json.load(fh)
return dt
def print_values_order_by_keys(dt):
sorted_keys = sorted(dt)
print sorted_keys
filename = raw_input("Enter the JSON file: ")
r = read_json(filename)
print_values_order_by_keys(r)
I am trying to print the objects in the alphabetic order of the keys. I was able to sort the keys in alphabetic order, but when I print them it gives me the keys and not the objects contained in them. Any advice?