fd
tty.isatty() 方法如果给定的 fd 与一个 TTY 相关联则返回 true,如果不是则返回 false,包括 fd 不是非负整数的情况。
tty.isatty()
true
false
【The tty.isatty() method returns true if the given fd is associated with a TTY and false if it is not, including whenever fd is not a non-negative integer.】