Aug-29-2020, 05:13 PM
I think what you're asking is to read the information one character at a time and assemble the string yourself.
It's a bit more work because input() knows to stop and hand you the whole thing when it gets the enter key. Here you have to pull in each character and decide when you're done. It also means that if the entering person types a mistake, you'll get the mistake first, then you'll probably get a backspace key and will have to decide how to "fix" it.
But if you want to try that there's readchar. I haven't used it myself, but should be a good starting point.
The shell isn't involved here. It's not processing the input, and it certainly doesn't know when you're done and it's the right time to send an enter.
It's a bit more work because input() knows to stop and hand you the whole thing when it gets the enter key. Here you have to pull in each character and decide when you're done. It also means that if the entering person types a mistake, you'll get the mistake first, then you'll probably get a backspace key and will have to decide how to "fix" it.
But if you want to try that there's readchar. I haven't used it myself, but should be a good starting point.
The shell isn't involved here. It's not processing the input, and it certainly doesn't know when you're done and it's the right time to send an enter.