6

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! running python in emacs

2 Answers 2

22

With your point in the *Python* buffer, run:

C-c M-o

or M-x comint-clear-buffer

Sign up to request clarification or add additional context in comments.

1 Comment

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.
-4

You can use M-x erase-buffer to clear the *Python* buffer (or any other buffer)

1 Comment

This throws an error in Python buffer: Text is read-only

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.