Scripter47 wrote:

> How do i get my ip address?
>
> in cmd.exe i just type "ipconfig" then it prints:
>       ...
>       IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
>       ...
> how can i do that in python??

#v+

python -c 'import re, urllib; print re.findall("<title>Your IP: (.+?)</title>", 
urllib.urlopen("http://myip.dk/";).read())[0]'

#v-

Cheers,

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

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

Reply via email to