Disable buffering for tool?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
recursive
Posts: 2
Joined: Wed Feb 28, 2007 12:52 am

Disable buffering for tool?

Post 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.
recursive
Posts: 2
Joined: Wed Feb 28, 2007 12:52 am

Post 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()
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Thanks for following up :D

Andrew
Post Reply