[Tutor] IP Address from Python module?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Aug 5 23:15:02 CEST 2005

On Fri, 5 Aug 2005, Joseph Quigley wrote:

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

Hi Joe,

I think you're looking for socket.gethostbyname().


Here's an example using the socket.gethostbyname() function:


More information about the Tutor mailing list