catch output of threads
William
wilk-spamout at flibuste.net
Fri Nov 29 15:59:10 EST 2002
martin at v.loewis.de (Martin v. Löwis) writes:
> William <wilk-spamout at flibuste.net> writes:
>
> > Is it possible to catch the output from print of differents threads ?
> > In a single thread, i can change the value of sys.stdout... but with
> > differents thread i don't know ?
>
> You can still change the value of sys.stdout, even for multiple
> threads. The print statement internally uses sys.stdout itself.
>
> If multiple threads interleave print statements, you will get mixed
> output on your replaced sys.stdout, just as you would with the
> standard sys.stdout.
It's why i cannot use this method... I specialy want to catch the output
to don't mix the ouput from all the threads.
Is there a way to redefine print ? (i don't think so but...)
--
William Dode - http://flibuste.net
More information about the Python-list
mailing list