select() problem, not timing out
Donn Cave
donn at u.washington.edu
Fri Jul 30 19:14:11 EDT 2004
In article <300720041335392859%JBrouwersAtProphICyDotCom at no.spam.net>,
Jean Brouwers <JBrouwersAtProphICyDotCom at no.spam.net> wrote:
> 1) The lists passed to select() must contain items the fileno() of the
> sockets, not the sockets themselves. Same for the returned lists.
>>> from select import select
>>> from sys import stdin
>>> select([stdin], [], [])
([<open file '<stdin>', mode 'r' at 0x110ef0>], [], [])
> 2) The last argument to select() is the timeout in seconds, a float.
> Instead of 1, try 1.0.
>>> select([stdin], [], [], 1)
([], [], [])
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list