[no subject]

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


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.