I created a ordered dict in Python 2.7. I then insert key,value pairs. The ordered dict keeps the order in which i insert the keys.
Now i use dump()
to write this to a file and all of sudden the order is messed up. I know that json does not care about order, but i read that with ordereddict
it should somehow work too?
Maybe just inserting is not enough, do i need to create a custom sort order based on what now is my insert order? So is there any hope?
Edit I found out that everything is right with python. It was the program to view the json after saving which disturbed the order.