Sep-24-2022, 05:06 PM
The program does not say that you have a terminal session when you are not attached to a tty. When it is not attached to a tty, it simply reads the standard input line by line and it takes the first character of each line as if the user had typed it in a terminal.
This allows automating input by the means of a pipe for example
This allows automating input by the means of a pipe for example
Output:$ simulate_keystrokes | python program.py