Can Someone help me to remove the " __PYTHON_EL_eval..." message when I use run-python in Emacs?
name = "Jack"
print(f"Hello {name}")
Inferior Python Output:
__PYTHON_EL_eval("name = \"Jack\"\nprint(f\"Hello {name}\")", "/Users/Shared/ej1.py") Hello Jack
This is a hack, but it worked for me:
(defun python-comint-filter (output)
(let* ((regexp "^.*__PYTHON_EL_\\(.*\\)\\(.*\\)[[:space:]]*$")
(lines (split-string output "\n"))
(filtered-lines (remove-if (lambda (line)
(or (string-match-p regexp line)
(string-match-p "^\\s-*$" line)))
lines)))
(if (equal (length lines) (length filtered-lines))
output
(mapconcat 'identity filtered-lines "\n"))))
and
(add-hook 'comint-preoutput-filter-functions 'python-comint-filter)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With