On Fri, 5 Aug 2005, Joseph Quigley wrote:

> Is it possible to get my internet and/or network IP address from Python?

import socket
ipaddr = socket.gethostbyname(socket.gethostname())


Some users report this gives a meaningless '127.0.0.1' (i.e., localhost), 
though.  But try it and see.  It works for me.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to