title: Geting specific key from JSON File
body: <p>I'm making a project in Python that requires a user's login info. I'm using a <code>UserInfo.json</code> to read the <code>username</code> and <code>password</code> values.</p>
  <p>this is my JSON:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;username&quot;: &quot;MyUsername&quot;,
    &quot;password&quot;: &quot;MyPassword&quot;
  }
  
  </code></pre>
  <p>and im currently using this block:</p>
  <pre class="lang-py prettyprint-override"><code>def readJson(filename):
      with open(filename, 'r') as f:
          data = json.loads(f)
      return data
  
  
  userData = readJson('UserInfo.json')
  print(userData['username'])
  </code></pre>
  <p>When I try to read the <code>username</code> key from the JSON. I get the following error:</p>
  <pre><code>TypeError: the JSON object must be str, bytes or byte array, not TextIOWrapper
  </code></pre>
  <p>Thanks in advance!</p>