def error ( * args ) : if sys . stdin . isatty ( ) : print ( 'ERROR:' , * args , file = sys . stderr ) else : notify_error ( * args )
how to show python error messges in tkinter
Display error message via stderr or GUI .
def error(*args):
    """Display error message via stderr or GUI."""
    if sys.stdin.isatty():
        print('ERROR:', *args, file=sys.stderr)
    else:
        notify_error(*args)