[Python-mode] ipython setup

Maik Beckmann beckmann.maik at googlemail.com
Sat Feb 4 23:10:15 CET 2012


Hello,

By utilizing edebug-defun I figured out how to setup python-mode
for ipython, so that completion works in a file buffer (M-TAB) as
well as in the ipython comint buffer (TAB):

  (setq py-complete-function 'ipython-complete
        py-shell-complete-function 'ipython-complete
        py-shell-name "ipython"
        py-which-bufname "IPython")

Without setting py-which-bufname to "IPython" emacs told me that
no process is connected the buffer. After setting it, it worked
as expected.  However, I figured this out by using edebug and it
might be just a hack.

My questions: Am I doing it the way I'm supposed to?  Are there
docs which talk about how to do it right?


Thanks,
Maik Beckmann

PS: I'm running Archlinux, where /usr/bin/{python,ipython} are
both Python 3.  The above setting worked when I've temporarily
altered these paths to point to python2 and ipython2
respectively.  I've changed these back and this is what I'm
actually using

  (setq py-complete-function 'ipython-complete
        py-shell-complete-function 'ipython-complete
        py-shell-name "ipython2"
        py-which-bufname "Ipython2")

along with these changes http://paste.pocoo.org/show/545846/


More information about the Python-mode mailing list