Serge Orlov wrote:
> Dmitry Anikin wrote:
>>I want to read stdin in chunks of fixed size until EOF
>>I want to be able (also) to supply data interactively in console
>>window and then to hit Ctrl+Z when finished
>
> [snip fighting with windows]
>
>>Read at most size bytes from the file (less if t
Dmitry Anikin wrote:
> I want to read stdin in chunks of fixed size until EOF
> I want to be able (also) to supply data interactively in console
> window and then to hit Ctrl+Z when finished
[snip fighting with windows]
> Read at most size bytes from the file (less if the read hits EOF before
>
I want to read stdin in chunks of fixed size until EOF
I want to be able (also) to supply data interactively in console
window and then to hit Ctrl+Z when finished
So what I do is:
while True:
s = sys.stdin.read(chunk_size)
if not s:
break
# do something with s
if stdin is standar