User Identification

Fredrik Lundh fredrik at pythonware.com
Tue Feb 8 07:39:17 EST 2005


Bob Parnes wrote:

>I have a python program on a server of an all-linux network. It needs to
> record the user name running it. Is there a way for the program to extract
> the name from the system without a separate log-in dialog?

how about:

>>> import getpass
>>> getpass.getuser()
'gromit'

</F> 






More information about the Python-list mailing list