getting current UNIX uid

Richie Hindle richie at entrian.com
Thu Jul 6 10:36:38 EDT 2006


[Johhny]
> I am trying to get the user that is running the scripts uid, I have had
> a look at the pwd module and it does not appear to offer that
> functionality. Is there any way within python to get that information ?

It's in the 'os' module:

>>> import os
>>> os.getuid()
553

-- 
Richie Hindle
richie at entrian.com



More information about the Python-list mailing list