title: I/O reading from a file (python)
body: <p>Ok, I have an IRC bot and I have a file full of nicknames (which are the admins for the bot), for example if someone types "!op" in the channel how would I go about making the bot read the file to see if the user who typed "!op" is in the list of admins and if he is then proceed with the action.. I'm just confused on how to make it read the file for the authorized users.. Your help will be appreciate it. Thanks.</p>
  
  <p>Can I use something like this..</p>
  
  <pre><code>      def isadmin(nick, 'masters.txt'):
        for admin in file:
            if nick == admin.rstrip():
                return True
        return False
  
       if data.find('!op') != -1:
       nick = data.split('!')[ 0 ].replace(':','')
       if nick == isadmin(nick, open('masters.txt')):
          sck.send('MODE ' + chan + ' +o ' + nick + '\r\n')
       else:
            sck.send('PRIVMSG ' + chan + ' :' + ' youre not my master ' + '\r\n')
  </code></pre>