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

核能气质少年 提交于 2019-12-01 18:29:07
MikeRand

For those wondering, I think the relevant behavior is discussed here, in emacs "7. Subprocesses\ 7.3 Buffering in shells and subprocesses".

"In a shell buffer, stdout is a pipe handle and so is buffered in blocks. If you would like the buffering behavior of your program to behave differently, the program itself is going to have to be changed; you can use setbuf and setvbuf to manipulate the buffering semantics."

Solved by adding the following to my init.el (see this SO link here for more detail):

(setenv "PYTHONUNBUFFERED" "x")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!