Pick out ip-address

Patrick Useldinger p at trick.lu
Mon Feb 16 15:58:57 EST 2004


On Mon, 16 Feb 2004 13:19:22 +0100, Alexander Födisch
<foedisch at eva.mpg.de> wrote:

>Can somebody help me? I want to pick-out the IP-address after my pc is 
>connected with the internet.

What about:

>>> import socket
>>> print socket.gethostbyname(socket.gethostname())
192.168.1.2

?
--
http://www.homepages.lu/pu/



More information about the Python-list mailing list