Getting external IP address

Cousin Stanley cousinstanley at hotmail.com
Tue Mar 6 13:47:43 EST 2007


> I have a PC behind a firewall, and I'm trying to programmatically
> determine the IP address visible from outside the firewall.
> ....

Steven .... 

  Following is another alternative that might at least
  be worth consideration ....

  I use the  lynx  command shown as a command-line alias
  under Debian linux ....
 
>>>
>>> import os
>>>
>>> pipe_in = os.popen( 'lynx --dump http://checkip.dyndns.org' )
>>>
>>> ip_addr = pipe_in.readlines()
>>>
>>> for this in ip_addr :
...     print this
...


   Current IP Address: 65.39.92.38


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list