title: How to look in a file if already exist and only append new entries from json?
body: <p>Code: </p>
  
  <pre><code>with open('test.txt', 'a+') as viewers:
      while data['result']['list'] != '':
          for users in data['result']['list']:
              if users['nickName'] in viewers:
                  break
              else:
                  viewers.write(users['nickName'] + '\n')
  </code></pre>
  
  <p>The json I am looking to write to a file is like below. 
  This json is from a live streaming where new users join all the time.
  I want to write all users to a file, so something like 'when the value of "list": is not empty, keep appending new users from json'. When the "list": does no contains values anymore (because there the live streaming has ended and there are no viewers), stop.</p>
  
  <pre><code>   {
        "code": 1,
        "result": {
          "liveType": 0,
          "watchNum": 1161,
          "rank": 0,
          "duringF": 0,
          "list": [
            {
              "price": 86,
              "userId": 303249,
              "img": "https://mp5.facecast.xyz/storage1/M00/13/CF/aPODCl2RJBKARTtTAAAD9Xj8lkw004.png",
              "nickName": "ChillMick"
            },
            {
              "price": 53,
              "userId": 259943,
              "img": "https://mp5.facecast.xyz/storage1/M09/11/90/aPODCl1Pa22AK4WgAAADcFKVlIk698.png",
              "nickName": "\ud83d\udd37\ud83d\udd39\u24c2\ufe0f"
            },
          ],
          "earning": 14850,
          "likeNum": 5154
        },
        "msg": "OK"
  </code></pre>
  
  <p>How can I only append new entries?</p>