socket.gethostbyname() AttributeError

John Smith someone at microsoft.com
Tue Mar 19 18:08:06 EST 2002


You are both right.  It does work.  It has to be a typo or the way that I am
passing the host value into the program.

Oh well...

Ralph

"Oleg Broytmann" <phd at phd.pp.ru> wrote in message
news:mailman.1016544391.11261.python-list at python.org...
> On Tue, Mar 19, 2002 at 01:12:58PM +0000, Ralph wrote:
> > I assumed that for scoket.gethostbyname(host), I was to pass a host of
the
> > type "theodore.chipmunks.com" and that I would get back an IP address as
a
> > doted quad.  Obviously I am wrong about the form of the arguement I am
to
> > pass to the function, because I am getting an AttributeError message.
> >
> > Can anyone offer some insight?
>
> Python 2.2 (#1, Dec 24 2001, 17:25:15)
> [GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import socket
> >>> socket.gethostbyname("www.python.org")
> '194.109.137.226'
>
> Oleg.
> --
>      Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
>            Programmers don't die, they just GOSUB without RETURN.
>





More information about the Python-list mailing list