[Top][All Lists]

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

[O] Babel python question: use of ipython and %cpaste

From: Arun Persaud
Subject: [O] Babel python question: use of ipython and %cpaste
Date: Mon, 02 Dec 2013 22:08:06 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0


being able to use python as a source block is great, but I often stumble
over the fact that when using sessions you have to treat empty lines in
a special way (i.e. as the end of an indentation block).

I was wondering if it would be easy to create an ipython mode, something

#+BEGIN_SRC ipython ...

where the content for a session is copied over to an ipython buffer
using the ipython magic %cpaste. This way empty lines should be treated

It would also have the nice side effect of giving access to other magic
commands within org-babel, such as %timeit or profiling.

Unfortunately, I don't know how to modify ob-python.el to achieve this.
Apart from setting py-shell, I'm not sure how to copy the body of the
source block over to use %cpaste and also how to create a trigger for
BEGIN_SRC ipython...

Would this work? Any idea on how to implement this?



reply via email to

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