You could write something like
    class ThreadSpecificFile:
        def set_stdout(f):
            self.files[thread_id] = f
        def write(data):
            self.files[thread_id].write(data)
    sys.stdout = ThreadSpecificFile()
where you'll have to fill out a few more things like thread_id,
__init__, and a way to clean up items from self.files when a thread
passes away.

Jeff

Attachment: pgpfNtl83qNgI.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to