import json
def read_json(filename):
dt = {}
fh = open(filename, "r")
dt = json.load(fh)
return dt
def print_keys(dt):
print "Keys: ", dt.keys()
# print "[%s]" % (', ' .join(dt.keys),)
filename = raw_input("Enter the JSON file: ")
r = read_json(filename)
print_keys(r)
I'm trying to print the keys (1 per line) and without the unicode before it. However, I keep getting all the keys in a list in a single line. Please help