SUGGEST: os.getuser()

Fredrik Lundh fredrik at pythonware.com
Sun Jan 16 12:43:28 EST 2000


Gerrit Holl wrote:
> may I suggest this function for in the posix module:
> 
> def getuser():
>     import pwd
>     return pwd.getpwuid(getuid())[0]

you'll find a more complete implementation of that
function in the getpass module:

http://www.python.org/doc/current/lib/module-getpass.html

</F>





More information about the Python-list mailing list