That's almost what you did in C++...
Cheers,
Aloys
On 8/10/06, Alan Jones <skyphyr(at)gmail.com> wrote:
>
> ooo - nice
> Is there a C++ crossplatform equivalent to this?
>
> Cheers,
>
> Alan.
>
> On 8/9/06, Aloys Baillet <aloys.baillet(at)gmail.com> wrote:
> > 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
> > --
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--
------=_Part_55368_14560686.1155249625381
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Yes there is one: yours!<br><br>From the Python doc: <br><b><tt class="function" id="l2h-1995" id="l2h-1995">getuser</tt></b>():<br>Return the ``login name'' of the user. Availability: <span class="Unix">Unix</span>, Windows.
<br>This function checks the environment variables <a class="envvar" id="l2h-1996" id="l2h-1996">LOGNAME</a>, <a class="envvar" id="l2h-1997" id="l2h-1997">USER</a>, <a class="envvar" id="l2h-1998" id="l2h-1998">LNAME</a>
and <a class="envvar" id="l2h-1999" id="l2h-1999">USERNAME</a>, in order, and returns the value of the first one
which is set to a non-empty string. If none are set, the login name from the
password database is returned on systems which support the <tt class="module"><a href="module-pwd.html">pwd</a></tt> module, otherwise, an exception is raised. <br><br>That's almost what you did in C++...<br><br>Cheers,<br>
<br>Aloys<br><br><div><span class="gmail_quote">On 8/10/06, <b class="gmail_sendername">Alan Jones</b> <<a href="mailto:skyphyr(at)gmail.com">skyphyr(at)gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
ooo - nice<br>Is there a C++ crossplatform equivalent to this?<br><br>Cheers,<br><br>Alan.<br><br>On 8/9/06, Aloys Baillet <<a href="mailto:aloys.baillet(at)gmail.com">aloys.baillet(at)gmail.com</a>> wrote:<br>> If you just want the logon username, independently of the platform, you can
<br>> just use<br>><br>> import getpass<br>> username = getpass.getuser()<br>><br>> my 2 cheap cents...<br>><br>> Aloys<br>><br>><br>> On 8/9/06, Alan Jones <<a href="mailto:skyphyr(at)gmail.com">
skyphyr(at)gmail.com</a>> wrote:<br>> > name not main. what a great start to the day.<br>> ><br>> > On 8/9/06, Alan Jones <<a href="mailto:skyphyr(at)gmail.com">skyphyr(at)gmail.com</a>> wrote:<br>> > > Sorry Brad - damn Gmail - saw the main from the reply below.
<br>> > ><br>> > > On 8/9/06, Alan Jones <<a href="mailto:skyphyr(at)gmail.com">skyphyr(at)gmail.com</a>> wrote:<br>> > > > I Bernard for the example of whoami you can instead use environment
<br>> > > > variables to pull the same data.<br>> > > ><br>> > > > char * buffer;<br>> > > > #ifdef Q_OS_WIN<br>> > > > buffer = getenv ("USERNAME");
<br>> > > > #endif<br>> > > ><br>> > > > #ifdef Q_OS_DARWIN<br>> > > > buffer = getenv ("USER");<br>> > > > #endif<br>> > > >
<br>> > > > #ifdef Q_OS_UNIX<br>> > > > buffer = getenv ("USER");<br>> > > > #endif<br>> > > ><br>> > > > That's the C++ edition, sorry - no python here.
<br>> > > ><br>> > > > Cheers,<br>> > > ><br>> > > > Alan.<br>> > > ><br>> > > > On 8/8/06, Bradley Gabe < <a href="mailto:withanar(at)stanwinston.com">
withanar(at)stanwinston.com</a>> wrote:<br>> > > > > I'm wondering if this is possible... I need to run os.system() calls<br>> > > > > through python, and I need to be able to see the line Python echos
<br>> as a<br>> > > > > result.<br>> > > > ><br>> > > > > So for example, if I want to run the command: whoami, I need to get<br>> the<br>> > > > > string value that is echoed. The
os.system() method itself just<br>> returns<br>> > > > > a number describing the status of the command.<br>> > > > ><br>> > > > > The purpose of this is to help in debugging Apache running mod
<br>> python,<br>> > > > > which is doing strange things regarding permissions.<br>> > > > ><br>> > > > > Any help or advice appreciated!<br>> > > > ><br>> > > > > -Brad
<br>> > > > ><br>> > > > > ---<br>> > > > > Unsubscribe? Mail <a href="mailto:Majordomo(at)Softimage.COM">Majordomo(at)Softimage.COM</a> with the following text in<br>> body:<br>> > > > > unsubscribe xsi
<br>> > > > ><br>> > > ><br>> > ><br>> > ---<br>> > Unsubscribe? Mail <a href="mailto:Majordomo(at)Softimage.COM">Majordomo(at)Softimage.COM</a> with the following text in body:<br>
> > unsubscribe xsi<br>> ><br>><br>><br>><br>> --<br>> Aloys Baillet - XSI Technical Director<br>> Character Dpt - Animal Logic<br>> --<br>---<br>Unsubscribe? Mail <a href="mailto:Majordomo(at)Softimage.COM">
Majordomo(at)Softimage.COM</a> with the following text in body:<br>unsubscribe xsi<br></blockquote></div><br><br clear="all"><br>-- <br>Aloys Baillet - XSI Technical Director<br>Character Dpt - Animal Logic<br>--
------=_Part_55368_14560686.1155249625381--
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi