source: vendor/python/2.5/Doc/lib/libgetpass.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.3 KB
Line 
1\section{\module{getpass}
2 --- Portable password input}
3
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}
9
10
11The \module{getpass} module provides two functions:
12
13
14\begin{funcdesc}{getpass}{\optional{prompt\optional{, stream}}}
15 Prompt the user for a password without echoing. The user is
16 prompted using the string \var{prompt}, which defaults to
17 \code{'Password: '}. On \UNIX, the prompt is written to the
18 file-like object \var{stream}, which defaults to
19 \code{sys.stdout} (this argument is ignored on Windows).
20
21 Availability: Macintosh, \UNIX, Windows.
22 \versionchanged[The \var{stream} parameter was added]{2.5}
23\end{funcdesc}
24
25
26\begin{funcdesc}{getuser}{}
27 Return the ``login name'' of the user.
28 Availability: \UNIX, Windows.
29
30 This function checks the environment variables \envvar{LOGNAME},
31 \envvar{USER}, \envvar{LNAME} and \envvar{USERNAME}, in order, and
32 returns the value of the first one which is set to a non-empty
33 string. If none are set, the login name from the password database
34 is returned on systems which support the \refmodule{pwd} module,
35 otherwise, an exception is raised.
36\end{funcdesc}
Note: See TracBrowser for help on using the repository browser.