testing if open to a terminal - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: testing if open to a terminal (/thread-15807.html) |
testing if open to a terminal - Skaperen - Feb-01-2019 the "test" command on Unix/Linux/Posix systems does have a means to test if a specified file descriptor is is open to a terminal or not. it does it like: test -t 1 i am looking for the pythonic way to do this. in general, i will need to apply this to stdin and less often to stdout and maybe sometimes stderr or other things.
|