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
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
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
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
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
#!/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