I found this on an artima forum:<br><br><a href="http://www.artima.com/forums/flat.jsp?forum=181&amp;thread=113874">http://www.artima.com/forums/flat.jsp?forum=181&amp;thread=113874</a><br><br><font color="#000000" face="tahoma,arial,sans-serif" size="-1">
This worked on my machine (win xp):<br><br>socket.getaddrinfo(socket.gethostname(), None)[0][4][0]</font><br><div><span class="gmail_quote"><br>On 8/10/06, <b class="gmail_sendername"><a href="mailto:emilia12@mail.bg">emilia12@mail.bg
</a></b> &lt;<a href="mailto:emilia12@mail.bg">emilia12@mail.bg</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;">hello list
<br><br>is there in python an independent from the system way to<br>obtain the IP<br><br>i am playng around<br>&lt;code&gt;<br>import sys<br>import os<br>ipconfname={'nt':'ipconfig', 'posix':'ifconfig'}<br>ipstr = os.popen
(ipconfname[<a href="http://os.name">os.name</a>] ).read()<br>#print ipstr<br>&lt;/code&gt;<br>but i found out that answer depends on <a href="http://os.name">os.name</a> ...<br><br>in this case i have to use a different parser for each
<br>system ... so is there another way to retrieve the IP?<br><br>regards,<br>e.<br><br>-----------------------------<br><br><a href="http://www.atol.bg">http://www.atol.bg</a> - Намери бившите си съученици и стари приятели!
<br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor
</a><br></blockquote></div><br>