title: Different behavior of json.dump() on Windows and Linux
body: <p>I wrote a python script to retrieve data from a website in json format using the requests library, and then I dump it into a json file. I have written a lot of code utilizing this data and have tested it in Windows only. Recently I shifted to a Linux system, and when the same python script is executed, the order of the keys in the json file is completely different.</p>
  
  <p>This is the code I'm using:</p>
  
  <pre><code>API_request = requests.get('https://www.abcd.com/datarequest')
                      alertJson_Data = API_request.json()         # To convert returned data to json
  json.dump(alertJson_Data, jsonDataFile)     # for adding the json data for the alert to the file
  jsonDataFile.write('\n')
  jsonDataFile.close()
  </code></pre>
  
  <p>A lot of my other scripts depends on the ordering of the keys in this json file, so is there any way to maintain the same ordering that is used in Windows to be used in Linux as well?
  For example in Windows the order is <code>"id":, "src":, "dest":,</code> whereas in Linux its completely different. If I directly go to the Web link on my browser, it has the same ordering as the one saved in Windows. How do I retain this ordering?</p>