Another Socket in Python

Peter Hansen peter at
Sat Aug 17 19:53:47 CEST 2002

Steven wrote:
> IIRC one thing to remember with select is that  you don't pass the actual
> socket in a list, you pass the file descriptor/number. You can get this by
> using the socket objects fileno() method.
>[s.fileno()],[],[], TIMEOUT)

Actually, Python handles this for you, as the docs note:

  "The first three arguments are lists of `waitable objects': 
   either integers representing file descriptors or objects with 
   a parameterless method named fileno() returning such an integer."

So you can just pass a reference to the socket instead.


More information about the Python-list mailing list