Reading single characters from stdin #2152
Replies: 1 comment 7 replies
-
the Anything else you could tell us about terminal limitation or what is it that you would like to achieve? |
Beta Was this translation helpful? Give feedback.
-
the Anything else you could tell us about terminal limitation or what is it that you would like to achieve? |
Beta Was this translation helpful? Give feedback.
-
I want to write a pyscript-micropython application that runs within the in-browser terminal and processes stdin. From what I can see standard in can only be accessed with
input
which reads a whole line. However for my application I want to read and process the characters from stdin one-by-one to react to them immediately. From what I can see in the corresponding code, don't see a way to do that. The code either processes the input in a very simple "readline"-type logic, or sends it toreplProcessChar
:https://github.com/pyscript/pyscript/blob/main/pyscript.core/src/plugins/py-terminal/mpy.js#L166
Are you aware of any workaround or could implement the possibility to read single characters from the terminal input?
Beta Was this translation helpful? Give feedback.
All reactions