Page 1 of 1

Disable buffering for tool?

Posted: Wed Feb 28, 2007 12:58 am
by recursive
How do I disable buffering for capturing output on tools? For example, I'm running a python script through textpad that may take several minutes or hours or days to complete, and I would like to see the output in the output window when it occurs, not when the buffer fills. How can this be accomplished? I know it can be done by sending a large amount of output to force the buffer to flush, but that's not exactly elegant.

Posted: Tue Sep 09, 2008 5:10 pm
by recursive
Well, I've answered my own question a year and a half later.

Textpad cannot control it. The script in question must flush standard output when it is desired to see the output.

In my case: (python)

Code: Select all

import sys
...
while 1:
    ...
    print "current status: " + status
    sys.stdout.flush()

Posted: Wed Sep 10, 2008 12:03 am
by ak47wong
Thanks for following up :D

Andrew