Context-aware return

random832 at fastmail.us random832 at fastmail.us
Thu Sep 10 16:42:26 EDT 2015


On Thu, Sep 10, 2015, at 16:15, Akira Li wrote:
> There are cases when it might be justified to alter the behavior e.g.,
> *colorama* allows to strip ANSI codes (e.g., disable colored output) if
> stdout is not a tty or *win-unicode-console* make sys.stdout to use
> WriteConsoleW() to write Unicode to Windows console (interactive case).

These conditions have nothing to do with whether it is running in the
interactive interpreter, since you can still be on the console (or a
tty) without being in the interactive interpreter. What you are talking
about is detecting file redirection.



More information about the Python-list mailing list