|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
i am a newbie with python and i did this program copied from internet (on debian woody with python 2.1):
# sockets import sys from socket import * #create an INET, STREAMing socket Sock = socket(AF_INET,SOCK_STREAM) Sock.connect(('www.google.com',80)) #now connect to the web server on port 80 # - the normal http port msg = '' while len(msg) < MSGLEN: chunk = Sock.recv(MSGLEN-len(msg)) if chunk == '': print "socket connection broken" sys.end() msg = msg + chunk totalsent = totalsent + sent print msg sys.end() i get this error from python : Traceback (most recent call last): File "mailer.py", line 7, in ? Sock = socket(AF_INET,SOCK_STREAM) NameError: name 'socket' is not defined so, where is defined socket if not in sockett module? ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > newbie stupid socket question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|