title: Python: Imported file displaying old information
body: <p>Surely this isn't as complicated as I'm making it out to be. I have a file storing user credentials which we'll call <code>logins.py</code>. My main script <code>app.py</code> writes new account details to <code>logins.py</code>'s lists <code>userkeys</code> and <code>passkeys</code>. To append new information to the credentials file <code>app.py</code> has to import <code>logins.py</code> before writing the new information. Problem is that when I do this old information is written to the file - items on the list I erased some time ago. Spooky. Here's some of my code:</p>
  
  <pre><code>import logins
  def createAccount(self, userkey, passkey):
      if userkey in logins.userkeys:
          return False
      else:
          logins.userkeys.append(userkey)
          logins.passkeys.append(passkey)
          with open('logins.py', 'w') as f:
              f.write(str(logins.userkeys + logins.passkeys))
  </code></pre>
  
  <p>If I enter a userkey of <code>aaa</code> and a passkey of <code>bbb</code> I get </p>
  
  <pre><code>userkeys = [12345, 'aaa']
  passkeys = ['67890', 'bbb'] 
  </code></pre>
  
  <p>12345 and 67890 are old userkeys and passkeys that I erased many moons ago that keep coming back. <code>importlib.reload</code> makes no difference. What am I missing?</p>