Displaying print messages- Emacs

David Bolen db3l at fitlinxx.com
Tue Jul 27 20:09:27 CEST 2004

Dave Benjamin <ramen at lackingtalent.com> writes:

> Hi Darren - not sure about the second question, but I might have an answer
> for the first...
> In article <ce18hn$hji$1 at news01.cit.cornell.edu>, Darren Dale wrote:
> > 1) Is it possible to have the *Python Output* in Emacs report the 
> > progress during execution? Right now, *Python Output* does not update 
> > until after the script completes.
> Try using sys.stdout.flush() at regular intervals in your code. I've had
> similar problems using Python+Emacs+Cygwin, and flushing the output buffer
> usually solved the problem.

Or just start Python with -u (unbuffered) or -i (interactive) from
within the shell.  Avoids the need to change the script.

The root cause is probably that Emacs' shell is not considered a TTY,
so it gets buffered output by default.

-- David

More information about the Python-list mailing list