Next / Previous / Contents / NM Tech homepage

9.3. transloader: readPassword()

transloader
# - - -   r e a d P a s s w o r d

def readPassword(fileName):
    '''Read a password from a named file

      [ fileName is a string naming a readable file ->
          return the first line of that file, stripped ]
    '''
    passFile = file(fileName)
    password = passFile.readline().strip()
    passFile.close()
    return password