isatty
The isatty module provides functions to check if the current process is
connected to a terminal.
The core functionality is provided by github.com/mattn/go-isatty (opens in a new tab).
Module
Function signature
isatty() boolThe isatty module object itself is callable, and returns a boolean indicating
whether the process is connected to a terminal. This module-level function does
not differentiate between cygwin and non-cygwin terminals, returning true in
both cases.
Example
>>> isatty()
trueFunctions
is_terminal
Function signature
is_terminal() boolReturns true if the current process is connected to a terminal.
Example
>>> isatty.is_terminal()
trueis_cygwin_terminal
Function signature
is_cygwin_terminal() boolReturns true if the current process is connected to a Cygwin terminal.
Example
>>> isatty.is_cygwin_terminal()
false