Hi I am using the emacs and elpy to run the python code as shown in the figure. Since the output result is so many, I want to erase or clear the console result. I want to make the console result be empty or clear. Is there emacs keys to clear the python console in the emacs or how to set it. Thanks in advance!

Add a comment
|
2 Answers
With your point in the *Python* buffer, run:
C-c M-o
or
M-x comint-clear-buffer
1 Comment
Satyajeet Kanetkar
This works because the shell provisioned by
C-c C-p or M-x run-python is built on top of comint-mode. This is a mode responsible for command-interpreter-in-buffer like functionality.You can use M-x erase-buffer to clear the *Python* buffer (or any other buffer)
1 Comment
subhacom
This throws an error in Python buffer:
Text is read-only