mirroring text window to file
Anand B Pillai
abpillai at lycos.com
Sat Apr 12 13:35:00 CEST 2003
In your program,
def write(self, output):
sys.stdout = YourClass
This will direct all 'print' output to the
write method of your class which is the
wrapper for the two methods you outlined.
Erik Max Francis <max at alcyone.com> wrote in message news:<3E978E80.AC7BA047 at alcyone.com>...
> Marcel Achim wrote:
> > I was wondering if there's an existing solution other than writing
> > to both a file and an output text window (Tk text widget), as in :
> > text_window.insert('end', output)
> > log_file.write(output)
> Write a wrapper class that does both.
More information about the Python-list