title: Check if json file has entries
body: <p>I want to see if my json file has any entries in it.</p>
  <p>Currently my json file looks like this:</p>
  <pre><code>{
  }
  </code></pre>
  <p>I want to check to see if a user has already added something to the json file (like for e.x <code>&quot;stackoverflow&quot;: &quot;test&quot;</code>).</p>
  <p>With this code I can list all objects in the file</p>
  <pre><code>    with open(&quot;keys.json&quot;) as f:
          data = json.load(f)
          for obj in data:
              print(obj)
  </code></pre>
  <p>Now I wantt to check if the json file is empty or not, I thought to do it so:</p>
  <pre><code>    with open(&quot;keys.json&quot;) as f:
          data = json.load(f)
          for obj in data:
              if not obj:
                  print(Fore.LIGHTRED_EX + &quot;No sites/TOTP codes have been added yet, add one first.&quot;)
  </code></pre>
  <p>However sadly this does not work, any ideas?</p>