emacs/Python: running python-shell in line buffered vs. block buffered mode

Posted by Begbie00 on Stack Overflow See other posts from Stack Overflow or by Begbie00
Published on 2010-05-21T10:41:35Z Indexed on 2010/05/21 15:20 UTC
Read the original article Hit count: 222

Filed under:
|
|

Hi all -

In a related question and answer here, someone hypothesized that python-shell within emacs(23.2) was block-buffered instead of line-buffered. The recommended fix was to add sys.stdout.flush() to the spot in my script where I want stdio to flush its contents to the python-shell.

Is there someway to trick python-shell (running in emacs 23.2 on Windows, not Linux) into either a) thinking it's attached to a TTY or b) using line-buffered instead of block-buffered mode? I don't see why I'd be able to do this in IDLE but not emacs.

I'd rather customize emacs than add sys.stdout.flush() throughout my scripts. Call me lazy :-).

Thanks,

Mike

© Stack Overflow or respective owner

Related posts about python

Related posts about emacs