PyDocs

Nav

Command-line interface libraries

getuser

getpass

function (source) not WASI
  • getuser()
Get the username from the environment or password database.

First try various environment variables, then the password
database.  This works on Windows as long as USERNAME is set.
Any failure to find a username raises OSError.

.. versionchanged:: 3.13
    Previously, various exceptions beyond just :exc:`OSError`
    were raised.
Changed in 3.13
  • 3.13: Previously, various exceptions beyond just OSError were raised.
0 Examples
No examples for getpass/getuser.
See Also
No see-alsos for getpass/getuser
0 Notes
No notes for getuser