Dictionaries in Python are implemented as hash tables, which is why the order appears random. You could implement your own variation of a dict that sorts, but you'd lose out on the convenient syntax. Instead, keep track of the order of the keys, too.
Initialization:
keys = []
myDict = {}
While reading:
myDict[key] = value
keys.append(key)
While writing:
for key in keys:
print key, myDict[key]