Adam wrote:

> This will get your IP address:
>
> #######Code########
> print socket.gethostbyaddr(socket.gethostname())
> ('compname', [], ['192.168.1.2'])
> ########End Code########

It will return an IP address, but not necessarily the one you want:

#v+

[EMAIL PROTECTED]:~ $ python -c 'import socket; print 
socket.gethostbyaddr(socket.gethostname())'
('zdani.szn.dk', [], ['2001:1448:89::1'])
[EMAIL PROTECTED]:~ $

#v-

Cheers,

-- 
Klaus Alexander Seistrup
http://klaus.seistrup.dk/

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

Reply via email to