how to get my internet ip address?
Joshua Muskovitz
joshm at taconic.net
Sat Jan 26 02:29:53 EST 2002
More information about the Python-list mailing list
Sat Jan 26 02:29:53 EST 2002
- Previous message (by thread): how to get my internet ip address?
- Next message (by thread): Sharing a cab to Pyhton 10
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gerhard, This might be of interest to you for use on your gateway machine: import socket hostname = socket.gethostname() addresses = socket.getaddrinfo(hostname, None) ips = [x[4][0] for x in addresses] This should give you all of the IP addresses for your machine. You would then have to determine which one was out to the universe, of course. -- # Joshua Muskovitz # joshm at taconic.net def lyyrs(sig): return '-'.join(sig.split()+["ly y'rs"]) lyyrs('Hire me! I need the work!') -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
- Previous message (by thread): how to get my internet ip address?
- Next message (by thread): Sharing a cab to Pyhton 10
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list