How to "hook" print statement.

Martin v. Loewis martin at v.loewis.de
Mon Mar 18 17:02:23 EST 2002


"Gillou" <nospam at bigfoot.com> writes:

> Any clue to have this done as transparently as possible ?

I recommend to replace sys.stdout, and use isatty to determine whether
it goes to the console or to a file.

HTH,
Martin




More information about the Python-list mailing list