Socket Error

Tiziano Bettio t.bettio at transnorm.ch
Thu Apr 14 14:44:13 EDT 2005


kingofearth.com at gmail.com wrote:

>When I try to open a socket with python i get the following error:
>
>Traceback (most recent call last):
>  File "./mailer", line 3, in ?
>    sock = socket.socket(socket.PF_INET, socket.SOCK_STREAM)
>NameError: name 'socket' is not defined
>
>the code is:
>
>#!/usr/bin/python
>
>sock = socket.socket(socket.PF_INET, socket.SOCK_STREAM)
>sock.connect(("mail.oasd.k12.wi.us", 25))
>sock.send("HELO")
>print sock.recv(8192)
>sock.close()
>
>  
>
tried:
import socket
???



More information about the Python-list mailing list