Python Forum

Full Version: testing if open to a terminal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.