> Okay, so now I've tried:
> s = socket (AF_INET, SOCK_STREAM)
> while (1):
> try:
> s.bind (HOST, PORT)
> except socket.error:
> sys.stdout.write (socket.error[0] + socket.error[1])
> continue
> break
> ie. removed the quotes and now I get:
> Traceback (innermost last):
> File "./t1.py", line 12
> except socket.error:
> TypeError: attribute-less object
It looks like you have done `from socket import *'. Then you bind the
socket-function to the name `socket' (which of course has no `error'
attribute).
To prevent name-clashes, it's almost always better to say something like
`import socket'. But then you must not forget to change
< s = socket (AF_INET, SOCK_STREAM)
into
> s = socket.socket(AF_INET, SOCK_STREAM)
-- Jan-Hein Buhrman -- AT&T Huizen NL -- <jbuhrma@hzsbg01.ns-nl.att.com> --
---------------------- +31 35 87.4799 --- ...!att!hvgtw!hzsbg01!jbuhrma ---
:w:q:wqZZ^X^C^\Quit - core dumped