I found this on an artima forum:http://www.artima.com/forums/flat.jsp?forum=181&thread=113874
This worked on my machine (win xp):socket.getaddrinfo(socket.gethostname(), None)[0][4][0]On 8/10/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:hello list
is there in python an independent from the system way toobtain the IPi am playng aroundimport sysimport osipconfname={'nt':'ipconfig', 'posix':'ifconfig'}ipstr = os.popen
(ipconfname[os.name] ).read()#print ipstrbut i found out that answer depends on os.name ...in this case i have to use a different parser for each
system ... so is there another way to retrieve the IP?regards,e.-http://www.atol.bg - Намери бившите си съученици и стари приятели!
___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor