Whenever I send the a Python buffer to the interpreter via C-x C-l
it prints the file eval call as shown below. While it does print the correct output, it's a bit annoying to see it every time and I'd like help getting rid of that behavior.
My question is, How to get rid of the __PYTHON_EL_eval_file("/Users/user/Documents/Sandbox/Python/test.py", "", False) that prints in the interpreter when the file is sent with C-x C-l?
Input
def main():
print("Hello World!")
if __name__ == "__main__":
main()
Output
>>> __PYTHON_EL_eval_file("/Users/user/Documents/Sandbox/Python/test.py", "", False)
Hello World!
I'm running on MacOS Ventura 13.2.1 (22D68), using Emacs from EmacsforOSX.
Here's the output of running M-x elpy-config
.
Elpy Configuration
Emacs.............: 28.2
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: python3 3.11.2 (/Library/Frameworks/Python.framework/Versions/3.11/bin/python3)
RPC virtualenv....: rpc-venv (/Users/user/.config/emacs/elpy/rpc-venv)
Python...........: python3 3.8.2 (/Users/user/.config/emacs/elpy/rpc-venv/bin/python3)
Jedi.............: 0.18.2
Autopep8.........: 2.0.2
Yapf.............: 0.32.0
Black............: Not found (23.1.0 available)
Syntax checker....: flake8 (/Library/Frameworks/Python.framework/Versions/3.8/bin/flake8)
Warnings
You have not activated a virtual env. It is not mandatory but often a good idea
to work inside a virtual env. You can use `M-x pyvenv-activate` or `M-x
pyvenv-workon` to activate one.
The directory ~/.local/bin/ is not in your PATH. As there is no active
virtualenv, installing Python packages locally will place executables in that
directory, so Emacs won't find them. If you are missing some commands, do add
this directory to your PATH -- and then do `elpy-rpc-restart'.
Options
`Raised' text indicates buttons; type RET or click mouse-1 on a button to
invoke its action. Invoke [+] to expand a group, and [-] to collapse an
expanded group. Invoke the [Group], [Face], and [Option] buttons below to edit
that item in another window.
[+]-- Group Elpy
[+]-- Group Python
[+]-- Group Virtual Environments (Pyvenv)
[+]-- Group Completion (Company)
[+]-- Group Call Signatures (ElDoc)
[+]-- Group Inline Errors (Flymake)
[+]-- Group Code folding (hideshow)
[+]-- Group Snippets (YASnippet)
[+]-- Group Directory Grep (rgrep)
[+]-- Group Search as You Type (ido)
[+]-- Group Django extension
[+]-- Group Autodoc extension
And the Python-specific parts of my init.el
(elpy-enable)
(setq elpy-rpc-python-command "python3")
(setq python-shell-interpreter "python3")
(setq python-shell-completion-native-disabled-interpreters '("python3"))
__PYTHON_EL_eval_file("/Users/user/Documents/Sandbox/Python/test.py", "", False)
that prints in the interpreter when the file is sent withC-x C-l