[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Org + Elpy Python + IPython

From: Ken Mankoff
Subject: Re: [O] Org + Elpy Python + IPython
Date: Tue, 20 May 2014 12:47:48 -0400
User-agent: mu4e; emacs 24.3.1

Addendum to this old thread:

On 2014-05-07 at 22:52, Ken Mankoff <address@hidden> wrote:
> FYI Org + Elpy + IPython all play nicely now.
> There have been some previous posts about people (me included) having
> trouble using the full IPython stack in Org Mode. Some of those
> problems were limited to when using sessions, and others only if
> trying to take full advantage of the nice Python support provided by
> Elpy (enabled via the (elpy-use-ipython) command).
> I think the primary issue was Org text analysis on the >>> prompt which
> in IPython becomes "In [n]:". This is solved with the "--classic" flag
> to ipython.
> With this setup:
> (setq org-babel-python-command "ipython --pylab=qt4 --pdb --nosep --classic 
> --no-banner --no-confirm-exit")
> I now have Org, Python, IPython, and Elpy (including
> (elpy-use-ipython)) all running together in session and non-session
> mode.

ipython --classic appears to let IPython work properly with Org, but it
does not. There are some nefarious bugs. For example, the second
indented for loop (foo, bar) never runs if the interpreter is "ipython
--classic", but runs properly for "python".

for n in [1,2]:
    print n
    for a in ['a','b']:
        print a

    for f in ['foo','bar']:
        print f

It appears that IPython munges empty lines differently than python. I've
tried the " --no-autoindent" and "--no-pprint" and the blank line still
causes problems. Anyway, I recommend sticking with plain Python which
works in all code I've tried both session and non-session.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]