title: user authentication script to run program using python
body: <p>i am new on python and just started learning, i want to create a simple script to run a program by authenticating user, valid or not...
  main problem, i am facing is that i have a file "users" in which i mentioned all valid users,
  so i need a program which searches the input given by user in "users" file, if found then continue otherwise "authentication failed"
  what i tried is ...</p>
  
  <p>fp = open("users", "r")</p>
  
  <p>for line in fp.readlines():</p>
  
  <pre><code> if "michel" in line :  # user michel is available in users file
      print "true"
   else :
      print "false"
  </code></pre>
  
  <p>it works, prints 'true' because michel is in file.. but in case of when user enters "mic" .. also prints true ...... so what will be the solution...</p>