It returns this<br>(&#39;hostname&#39;, [], [&#39;<a href="http://127.0.1.1">127.0.1.1</a>&#39;])<br>i am running this on a linux system<br>thanks<br><br><div class="gmail_quote">On Jan 2, 2008 8:50 AM, jay &lt;<a href="mailto:titleistfour@gmail.com">
titleistfour@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well that will return the reverse lookup of the current hostname assigned to your system.&nbsp; Is this a Windows or Linux/Unix system?&nbsp; What does this return?
<br><br>print socket.gethostname()<br>print socket.gethostbyaddr(socket.gethostname
())<br><font color="#888888"><br>j</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Jan 2, 2008 8:45 AM, shawn bright &lt;<a href="mailto:nephish@gmail.com" target="_blank">nephish@gmail.com</a>
&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, Jay,<br>in IDLE, this gave me <a href="http://127.0.0.1" target="_blank">127.0.0.1</a><br>is there a way to get my assigned ip instead of the localhost one?<br>thanks<div><div></div><div><br><br><div class="gmail_quote">

On Jan 2, 2008 8:31 AM, jay &lt;
<a href="mailto:titleistfour@gmail.com" target="_blank">titleistfour@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

You could perhaps use this method
<br><br>import socket<br>myIP = socket.gethostbyaddr(socket.gethostname())[2]<br><br>Jay<br><br><div class="gmail_quote"><div><div></div><div>On Jan 2, 2008 8:25 AM, shawn bright &lt;<a href="mailto:nephish@gmail.com" target="_blank">



nephish@gmail.com</a>&gt; wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Greetings, 
<br><br>i am looking for an easy way to get my own ip address as a string from python. 
<br>I am using Ubuntu Linux if that makes any difference. <br>thanks !<br><font color="#888888"><br>shawn<br>
</font><br></div></div>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">


http://mail.python.org/mailman/listinfo/tutor
</a><br><br></blockquote></div><br>
<br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">

http://mail.python.org/mailman/listinfo/tutor
</a><br><br></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor
</a><br><br></blockquote></div><br>