codecraig wrote: > hi, > how can i use python to figure the ip address of the machine which > the python script is running on? I dont mean like 127.0.0.1....but i > want the external IP address (such as ipconfig on windows displays).
I use the following (all on one line): external_ip = os.popen("/sbin/ifconfig eth0|/bin/grep inet|/bin/awk '{print $2}' | sed -e s/.*://", "r").read().strip() Cheers, Andy -- http://mail.python.org/mailman/listinfo/python-list