Re: Select in Python

2006-06-29 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Gary Herron <[EMAIL PROTECTED]> wrote: >If you want select to start blocking again, you must read all bytes from >stdin whenever select says there are bytes to be read. To add to this, it is a good idea to read the select_tut(2) man page, particularly the "SELECT

Re: Select in Python

2006-06-26 Thread Dio
K.S.Sreeram 写道: > Dio wrote: > > while 1: > > (rr, wr, er) = select([stdin], [], []) > > for fd in rr: > > print fd > > > > program block in the first select(), after I type something and "enter > > ", it never block in select() again,why? > > select blocks until there is some dat

Re: Select in Python

2006-06-26 Thread Gary Herron
Dio wrote: > #!/usr/bin/env python2 > > from sys import stdin > from select import select > > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again

Re: Select in Python

2006-06-26 Thread K.S.Sreeram
Dio wrote: > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again,why? select blocks until there is some data to read from stdin, but it does no

Re: Select in Python

2006-06-26 Thread Fredrik Lundh
Dio wrote: > from sys import stdin > from select import select > > while 1: > (rr, wr, er) = select([stdin], [], []) > for fd in rr: > print fd > > program block in the first select(), after I type something and "enter > ", it never block in select() again,why? if there's data w

Select in Python

2006-06-26 Thread Dio
#!/usr/bin/env python2 from sys import stdin from select import select while 1: (rr, wr, er) = select([stdin], [], []) for fd in rr: print fd program block in the first select(), after I type something and "enter ", it never block in select() again,why? -- http://mail.python.or