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

Fredrik Lundh fredrik at
Fri Mar 2 09:04:18 CET 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?


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

Cheers /F

More information about the Python-list mailing list