ipython setup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ipython setup

Maik Beckmann
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/
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: ipython setup

Andreas Röhler-2
Am 04.02.2012 23:10, schrieb Maik Beckmann:

> 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?

Hi,

you should not need any customization for IPython.
There was a bug, which shold be gone now. Could you try from current
trunk again?

Made a bug report lp:927136 for this. Let's continue there, should
something being left.

thanks for your report,

Andreas


>
>
> 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/


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: ipython setup

rosoloum
I am also having troubles setting up python-mode to work with ipython. I am using python-mode.el 6.0.4 (latest version, released on 2011-12-30).

On the Launchpad site I see the following series and milestones posterior to 6.0.4:

6.0.4, 6.05, 6.1 and 6.1.1

When you said "could you try from the current trunk again?" which version do you mean?




Reply | Threaded
Open this post in threaded view
|

Re: ipython setup

Andreas Röhler-2
Am 14.02.2012 16:12, schrieb rosoloum:

> I am also having troubles setting up python-mode to work with ipython. I am
> using python-mode.el 6.0.4 (latest version, released on 2011-12-30).
>
> On the Launchpad site I see the following series and milestones posterior to
> 6.0.4:
>
> 6.0.4, 6.05, 6.1 and 6.1.1
>
> When you said "could you try from the current trunk again?" which version do
> you mean?
>

constants versions number of the trunk is rather meaningless - it's just
higher than the last released one. With trunk the revision, the check-in
stamp is important.

get the last revision by

bzr branch lp:python-mode


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: ipython setup

rosoloum
Thanks!  I just installed the latest version.

In your previous post in this thread you said:

" .... you should not need any customization for IPython.  There was a bug, which shold be gone now. Could you try from current  trunk again?  ... "

However, when I tried M-x ipython but I got "no match"

I have the following on my .emacs file:

(add-to-list 'load-path "~/.emacs.d/python-mode/")
(setq py-install-directory "~/.emacs.d/python-mode/")
(require 'python-mode)

Is there anything else I need to put in my .emacs file to debug and execute my code on an IPython  buffer?

Thanks

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: ipython setup

Andreas Röhler-2
Am 14.02.2012 17:01, schrieb rosoloum:
> Thanks!  I just installed the latest version.
>
> In your previous post in this thread you said:
>
> " .... you should not need any customization for IPython.  There was a bug,
> which shold be gone now. Could you try from current  trunk again?  ... "
>
> However, when I tried M-x ipython but I got "no match"
>

Please make an entry at

https://bugs.launchpad.net/python-mode

start from emacs -q, evaluate these install forms and send the output
from M-x report-emacs-bug

Thanks,

Andreas

[ ... ]
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode