I would like to print a python dictionary to a file using PrettyPrinter (for human readability) but have the dictionary be sorted by key in the output file to further improv
I had the same problem you had. I used a for loop with the sorted function passing in the dictionary like so:
for item in sorted(mydict): print(item)