title: Python append only unique names instead of duplicates
body: <p>So its a bot for an online Im called chatango.
  its a whitelist that shows who all are allowed to use the bot.</p>
  
  <p>The code is : </p>
  
  <pre><code>whitelist = []
  f = open("users/"+name+".txt", "r") # read-only
  print("[INFO]LOADING WHITELIST-LVL-1...")
  soundz("info")
  time.sleep(1)
  for name in os.listdir(path):
   if len(name.strip()[:-4])&gt;0: whitelist.append(name.strip()[:-4])
  f.close()
  </code></pre>
  
  <p>When i add one more person to the list using</p>
  
  <pre><code> open("users/"+name+".txt", 'w')
  </code></pre>
  
  <p>and when it is reloaded it makes duplicates in the list </p>
  
  <pre><code>eg 
  Before: man1,man2,man3 
  [Reloaded] 
  After: man1,man2,man3man1,man2,man3,man4
  </code></pre>
  
  <p>How do i make it</p>
  
  <pre><code>man1,man2,man3,man4 instead of man1,man2,man3man1,man2,man3,man4 
  </code></pre>
  
  <p>after reload? </p>
  
  <p>Please help</p>