getting current UNIX uid

Eric Deveaud edeveaud at pasteur.fr
Thu Jul 6 10:34:12 EDT 2006


Johhny wrote:
>  Hello,
> 
>  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 ?

eg:
username = pwd.getpwuid(os.getuid())[4]

	Eric




More information about the Python-list mailing list