Task

Demonstrate how to check whether the input device is a terminal or not.



Related task

   Check output device is a terminal


from sys import stdin
if stdin.isatty():
    print("Input comes from tty.")
else:
    print("Input doesn't come from tty.")