reading mystery after dupterm #17436
Unanswered
WimWWimW
asked this question in
Using MicroPython
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider this class to log and, eventually, intercept all I/O through the usb line (code below). All that's going through stdout/stderr is logged to the file - no problem there. My issue is with reading from stdin.
readinto(...)
is called for eachinput(...)
,stdin.read(...)
andstdin.readline(...)
as expected. But apparently, only for the first character of the input. The number of bytes read is always 1 and the buffer just contains a single character (the correct one). It would be perfectly understandable ifreadinto
would be called multiple times, but that I do no see to happen. Yet the result of the read action is correct. How can this happen?Beta Was this translation helpful? Give feedback.
All reactions