On 07Jun2011 20:22, Nitin Pawar <nitinpawar...@gmail.com> wrote:
| import getpass
| user = getpass.getuser()
| 
| On Tue, Jun 7, 2011 at 7:54 PM, TheSaint <nob...@nowhere.net.no> wrote:
| > I was trying to find out whose the program launcher, but os.environ['USER']
| > returns the user whom owns the desktop environment, regardless the program
| > is called by root.
| > I'd like to know it, so the program will run with the right privileges.
[...]

>From the getuser() doco:

  Get the username from the environment or password database.
  First try various environment variables, then the password database

So, no, wrong suggestion.

Cheers,
-- 
Cameron Simpson <c...@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Dangerous stuff, science.  Lots of us not fit for it.
        - H.C. Bailey, _The Long Dinner_
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to