finding IP address of computer

Jorge Godoy godoy at ieee.org
Thu Apr 27 13:17:46 EDT 2006


Chris wrote:

> hehe, works a charm, cheers mate.

Beware that if you have a different entry in your hosts file you can match a
different name.

Test it:

- add "127.0.0.2    yourhost.yourdomain yourhost" to /etc/hosts
- rerun the code.

You'll see "127.0.0.2" as the result.  So take that into account.

-- 
Jorge Godoy      <godoy at ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.



More information about the Python-list mailing list