AF_INET error

Soundwave maybe at lucky.com
Tue Apr 11 23:05:11 CEST 2000


Thanx, it was a file called socket.py, witch I had made myself, stupid of
me, I could have thought of it myself.

sorry for bothering you guys

thanx
Gordon McMillan <gmcm at hypernet.com> schreef in berichtnieuws
1256641280-42160733 at hypernet.com...
> Soundwave wrote:
>
> > On www.python.org is a HOWTO guide for creating sockets, i'll give an
> > example from what is said in the guide
> >
> > This is the first example
> >
> > import socket
> > #create an INET, STREAMing socket
> > s = socket.socket(
> >     socket.AF_INET, socket.SOCK_STREAM)
> > #now connect to the web server on port 80
> > # - the normal http port
> > s.connect("www.mcmillan-inc.com", 80)
> >
> > when I run this code, I get the following output
> >
> > Traceback (innermost last):
> >   File "C:\PROGRA~1\PYTHON\TOOLS\IDLE\ScriptBinding.py", line 131, in
> > run_module_event
> >     execfile(filename, mod.__dict__)
> >   File "C:/Program Files/Python/socket.py", line 3, in ?
> >     s = socket.socket(
> > AttributeError: AF_INET
>
> It seems you have a module named socket.py which is being
> imported instead of the standard one (which would be
> Lib/socket.py).
>
> - Gordon
>





More information about the Python-list mailing list