My current python setup in emacs is:
(setq py-shell-name "ipython") ;; sudo pip install ipython
(setq py-shell-name "/usr/local/bin/ipython")
(setq py-force-py-shell-name-p t)
(add-to-list 'load-path "~/.emacs.d/python-mode.el-6.1.0/")
(setq py-install-directory "~/.emacs.d/python-mode.el-6.1.0/")
(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
In a python file, I start the python interpreter with "C-c !" (py-shell). I evaluate region of codes with "C-c |" (py-execute-region).
If I execute each of the following line individually,
x = "hello world"
x
print(x)
I get the following in the python shell buffer:
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]:
In [5]:
In [6]: hello world
In [7]:
If I use the default python interpreter, I get
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> hello world
>>>
Questions:
Are these behaviour correct (not showing which code is being evaluated, and not showing what a python interpreter would normally print)?
How do I set it so that the python shell prints output like a normal python interpreter in the terminal? (with input code and output printed)
I guess I'm used to ESS for R. Thanks.