Based on this question I discovered how to fix the echoing problem in the python shell in emacs. What I want to do is add this to my .emacs file so that it will happen automatically.
(defun python-startup ()
(setq comint-process-echoes t))
(add-hook 'py-shell-hook 'python-startup)
If I start a python shell (M-x python-shell
), this hasn't worked.
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 22
22
22
I can run this function with M-: (python-startup)
, and then the echoing behavior stops.
>>> 22
22
I don't know if I'm setting up the hook incorrectly, or if I should be using a different hook altogether. As a side note, how do I know what hook is called for what function? The end goal is to end up being able to use :results output :session
in org-mode so that I can integrate python code without the results echoing every command. I suspect that once I fix the hook, that is the behavior I will have, but I don't actually know if this is true.