On Tue, Jan 20, 2009 at 10:28 AM, Nehemiah Dacres <vivacar...@gmail.com> wrote:
> Is ther an easy way to get the resolved ip address of the machine a script
> is running on? socket.gethostbyname(socket.gethostname) has only returned
> the ip address of my loop back interface ... not very usefull.

That's because your /etc/hosts resolves
your hostname to 127.0.0.1 :)

And no I know of no "easy" way cross
platform way. Perhaps parsing the output
of ifconfig itself ?

cheers
James
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to