M
Mike Maxwell
When I invoke readline() in a for loop, why does it return a series of
one-char strings, rather than the full line?
....
abc
a
b
c
(I typed in 'abc', and the loop printed out 'a\nb\nc\n')
I.e. how can I make readline() wait for the newline before returning a
value? 'readline()' seems to be acting exactly like 'read()' here.
('readlines()' works fine in this context, except that it waits for
eof; I'd really rather iterate over lines in stdin as they come in)
one-char strings, rather than the full line?
....
abc
a
b
c
(I typed in 'abc', and the loop printed out 'a\nb\nc\n')
I.e. how can I make readline() wait for the newline before returning a
value? 'readline()' seems to be acting exactly like 'read()' here.
('readlines()' works fine in this context, except that it waits for
eof; I'd really rather iterate over lines in stdin as they come in)