Try os.getuid() and os.geteuid() -- do they return different things? Do they return the same thing, neither of which is your normal userid?
You can turn a UID into a name with pwd.getpwuid(); returns a structure, but the pw_name field on the structure should be a user name.
http://docs.python.org/library/os.html
$ sudo su -
# python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, pwd
>>> pwd.getpwuid(os.getuid())[0]
'root'
- T
--
Meetings Schedule / RVSP on our Meetup at http://python.mn
---
You received this message because you are subscribed to the Google Groups "PyMNtos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymntos+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.