find login name of user?

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Dec 31 02:12:45 EST 2006


In message <1167511677.250618.285250 at v33g2000cwv.googlegroups.com>,
rattan at cps.cmich.edu wrote:

> Is there a function/module to find the login name of the user under
> UNIX environment?

Note that there isn't really an important concept of "login name" under *NIX
systems. There is the current process UID and GID, effective UID and GID
and so on, but these are just numbers, not names.

The OS doesn't remember anywhere the actual name that you used to login
with; this is conventionally saved in the USER environment variable, but
this is purely for informational purposes.



More information about the Python-list mailing list