Using TCP/IP

Tim Roberts timr at probo.com
Wed Oct 1 23:19:41 EDT 2003


jblazi <jblazi at hotmail.com> wrote:
>
>On Tue, 30 Sep 2003 02:09:15 +0300, Christos "TZOTZIOY" Georgiou wrote:
>
>> import socket
>> socket.gethostbyname(socket.gethostname())
>
>Thx. But this does not seem to work correctly. When I start the program
>and print the result, I get an IP-address but it is not the correct one
>i.e. not the one I am currently using.

Perhaps you had better define "the one I am currently using" and how you
are determining it.  That call will give you the IP address that your
computer thinks it is using.  If you have gateways or firewalls, that might
be completely unrelated to your external IP address.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.




More information about the Python-list mailing list