(msg)
Only forward the message to stdout if it is a terminal.
Only forward the message to stdout if it is a terminal.
Only forward the message to stdout if it is a terminal .
def interactive(msg):
    """Only forward the message to stdout if it is a terminal."""
    if hasattr(sys.stdout, "interactive"):
        sys.stdout.interactive(msg)
    else:
        if sys.stdout.isatty():
            sys.stdout.write(msg)
def interactive ( msg ) : if hasattr ( sys . stdout , "interactive" ) : sys . stdout . interactive ( msg ) else : if sys . stdout . isatty ( ) : sys . stdout . write ( msg )