socket error

Thomas Wouters thomas at xs4all.net
Thu Jul 6 07:10:41 EDT 2000


On Thu, Jul 06, 2000 at 03:09:32AM +0000, Duke wrote:
> I'm using Python 1.5.2 for Windows 98, and am trying to do some socket
> stuff.  Copying an example right out of the manual (section 7.2.2), I get
> the following error:

>   File "C:/Programming/Python/socket.py", line 5, in ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>     s = socket (AF_INET, SOCK_STREAM)
> NameError: socket

You named the file 'socket.py', did you ? :-) Don't do that. 'import socket'
will then load your own file again, instead of the 'socket' module.

> The example I'm using works fine on my Linux box Python interpreter, version
> 1.5.2.
> Any ideas?

You probably named it differently, under Linux ?

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list