1 \section{\module{getpass
}
2 --- Portable password input
}
4 \declaremodule{standard
}{getpass
}
5 \modulesynopsis{Portable reading of passwords and retrieval of the userid.
}
6 \moduleauthor{Piers Lauder
}{piers@cs.su.oz.au
}
7 % Windows (& Mac?) support by Guido van Rossum.
8 \sectionauthor{Fred L. Drake, Jr.
}{fdrake@acm.org
}
11 The
\module{getpass
} module provides two functions:
14 \begin{funcdesc
}{getpass
}{\optional{prompt
}}
15 Prompt the user for a password without echoing. The user is
16 prompted using the string
\var{prompt
}, which defaults to
18 Availability: Macintosh,
\UNIX{}, Windows.
22 \begin{funcdesc
}{getuser
}{}
23 Return the ``login name'' of the user.
24 Availability:
\UNIX{}, Windows.
26 This function checks the environment variables
\envvar{LOGNAME
},
27 \envvar{USER
},
\envvar{LNAME
} and
\envvar{USERNAME
}, in order, and
28 returns the value of the first one which is set to a non-empty
29 string. If none are set, the login name from the password database
30 is returned on systems which support the
\refmodule{pwd
} module,
31 otherwise, an exception is raised.