|
If you just want the logon username, independently of the platform, you can just use
import getpass username = getpass.getuser()
my 2 cheap cents...
Aloys
On 8/9/06,
Alan Jones <skyphyr(at)gmail.com> wrote:
name not main. what a great start to the day.
On 8/9/06, Alan Jones <skyphyr(at)gmail.com> wrote: > Sorry Brad - damn Gmail - saw the main from the reply below. >
> On 8/9/06, Alan Jones <skyphyr(at)gmail.com> wrote: > > I Bernard for the example of whoami you can instead use environment > > variables to pull the same data.
> > > > char * buffer; > > #ifdef Q_OS_WIN > > buffer = getenv ("USERNAME"); > > #endif > > > > #ifdef Q_OS_DARWIN
> > buffer = getenv ("USER"); > > #endif > > > > #ifdef Q_OS_UNIX > > buffer = getenv ("USER"); > > #endif
> > > > That's the C++ edition, sorry - no python here. > > > > Cheers, > > > > Alan. > > > > On 8/8/06, Bradley Gabe <
withanar(at)stanwinston.com> wrote: > > > I'm wondering if this is possible... I need to run os.system() calls > > > through python, and I need to be able to see the line Python echos as a > > > result.
> > > > > > So for example, if I want to run the command: whoami, I need to get the > > > string value that is echoed. The os.system() method itself just returns > > > a number describing the status of the command.
> > > > > > The purpose of this is to help in debugging Apache running mod python, > > > which is doing strange things regarding permissions. > > > > > > Any help or advice appreciated!
> > > > > > -Brad > > > > > > --- > > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> > > unsubscribe xsi > > > > > > --- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
-- Aloys Baillet - XSI Technical Director Character Dpt - Animal Logic --
|