emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Arun Persaud <apersaud@lbl.gov>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Babel python question: use of ipython and %cpaste
Date: Mon, 02 Dec 2013 22:08:06 -0800	[thread overview]
Message-ID: <529D7546.3080500@lbl.gov> (raw)

Hi

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
like

#+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
correctly.

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?

Thanks

Arun

             reply	other threads:[~2013-12-03  6:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  6:08 Arun Persaud [this message]
2013-12-03 11:44 ` Babel python question: use of ipython and %cpaste Rasmus
2013-12-03 20:35   ` Arun Persaud
2013-12-03 12:48 ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529D7546.3080500@lbl.gov \
    --to=apersaud@lbl.gov \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).