J Berends wrote:
def getipaddr(hostname='default'):
[snip]
It returns the IP address with which it connects to the world (not lo),
might be a pvt LAN address or an internet routed IP. Depend on where the
host is.
I hate the google trick actually, so any suggestions to something better
is always welcome.
Yes your IP is determined really by what you connect to.
So I did essentially the same as you.
For reference see getMyIPAddress() at the following:
http://www.pixelbeat.org/libs/PadSocket.c
Pádraig
--
http://mail.python.org/mailman/listinfo/python-list