astropy.utils
astropy.utils.console.
isatty
Returns True if file is a tty.
True
file
Most built-in Python file-like objects have an isatty member, but some user-defined types may not, so this assumes those are not ttys.