User Identification

Michael Ströder michael at stroeder.com
Tue Feb 8 12:20:38 EST 2005


Gerhard Haering wrote:
> 
> os.getuid() will give you the user id, but I don't know if Python has
> methods to look up more information from that from /etc/passwd or
> whereever from.

 >>> import pwd,os
 >>> pwd.getpwuid(os.getuid())
('michael', 'x', 1234, 100, 'Michael Str\xf6der', '/home/michael', 
'/bin/bash')
 >>>

Ciao, Michael.



More information about the Python-list mailing list