Using OS time (Donn Cave)
tireseas at onetel.com
Fri Jun 20 21:34:07 CEST 2003
On Friday 20 Jun 2003 20:08, donn cave wrote:
> import os
> import select
> class TimeoutError(Exception):
> def readto(maxsize, timeout):
> r, w, e = select.select(, , , timeout)
> if r:
> return os.read(0, maxsize)
> raise TimeoutError
> I used 0 and os.read where you might currently be using the stdin
> file object. stdin reads from unit 0, but it adds some buffering
> that can confuse matters when also using select.
> Stay away from signals when possible - if there's anything worse
> than signals, it's signals in Python.
> Donn Cave, donn at u.washington.edu
Could you walk me through what you are doing in the 'readto' function ... I'm
a little slow on the uptake.
What's the deal with signals in Python?
|| Reg. Linux User: 313143 ||
Sign the Petition:
More information about the Python-list