How can I get the logged in users username on Win32?

Fredrik Lundh fredrik at pythonware.com
Fri Mar 2 03:04:18 EST 2001


"nomad" wrote:
> After searching through the Python Docs, I found that on Un*x I could
> use getpass.getuser(), but there is no equivalent for the Win32
> platform.
>
> In other words, how can I get the username in Windows?

getpass.getuser()

(it works as long as USERNAME is set, which it usually is)

Cheers /F





More information about the Python-list mailing list