By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,764 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,764 IT Pros & Developers. It's quick & easy.

getting current UNIX uid

P: n/a
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 ?

Regards,

Johhny

Jul 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Jul 6 '06 #2

P: n/a

[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
ri****@entrian.com
Jul 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.