title: Writing to a file from a Flask Server
body: <p>I am writing a small application. pretty small one just to learn some new technologies.( angular -- front end) , Flask for server side . In the server, I have to store all the users info in a file. This file has all the usernames and passwords. 
  I have tried this : ( But not working ):</p>
  
  <pre><code>    f=open('userinfo.txt','w')
      f.write(app.users)
      f.close()
  </code></pre>
  
  <p>here I store the username and the password in app.users which is a dictionary.</p>
  
  <pre><code>    app= Flask(__name__)
  
      app.users={}
  </code></pre>
  
  <p>These two lines show the dictionary part. </p>
  
  <p>How can I store all the usernames and passwords in a file. How can I implement this. Help. any tutorials where I can learn.</p>