title: How to add to a json file in python
body: <p>I can read the json file and set the information I need to the variables. I have accounts, and I need to be able to add an account to it, this is the code I have so far:</p>
  
  <pre><code>import json
  
  user = raw_input("User: ")
  
  with open('text.json') as data_file:
      data = json.load(data_file)
  
  code =  data["users"][user]["pass"]
  display = data["users"][user]["display"]
  
  print "Password: " + code
  print "Display Name - " + display
  </code></pre>
  
  <p>This works fine to read the file, here is the expected format of the output json file:</p>
  
  <pre><code>{
    "users":{
      "User1": {
        "display": "User1",
        "pass": "EzPass123"
      },
      "Richard": {
        "display": "Attack69",
        "pass": "Smith"
      }
    }
  }
  </code></pre>
  
  <p>Can someone show me how to add another account to the accounts already existing in the dictionary?</p>