emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Seth Burleigh <wburle@gmail.com>
Cc: Emacs-orgmode@gnu.org
Subject: Re: [Babel][BUG] Executing python code fails due to indentation error
Date: Tue, 07 Sep 2010 16:44:30 -0600	[thread overview]
Message-ID: <874oe1xi9f.fsf@gmail.com> (raw)
In-Reply-To: AANLkTimaM0Q6k1T7gRb1VKeWMW5TCdMTpiiTnxCJsy02@mail.gmail.com

Hi Seth,

This works fine for me with external evaluation, e.g.
--8<---------------cut here---------------start------------->8---
#+begin_src python
def add(a,b):
   return a+b
def sub(a,b):
   return a-b
return add(sub(10,1),sub(10,2))
#+end_src

#+results:
: 17
--8<---------------cut here---------------end--------------->8---

I did notice that when I added a ":session test" header argument the
interactive shell output the error you mentioned.  This issue would have
to be resolved by the Python inferior process either python-mode or
python-shell.

Best -- Eric

Seth Burleigh <wburle@gmail.com> writes:

> #+begin_src python
> def add(a,b):
>    return a+b
> def sub(a,b):
>    return a-b
> #+end_src
>
> Fails to execute due to 'unexpected indentation' in general, this is a
> problem for copy/pasting into any emacs python shell, it wont work.
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2010-09-07 23:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 23:06 [Babel][BUG] Executing python code fails due to indentation error Seth Burleigh
2010-09-07 22:25 ` Noorul Islam
2010-09-07 22:44 ` Eric Schulte [this message]
2010-09-08  3:11   ` Seth Burleigh

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=874oe1xi9f.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=wburle@gmail.com \
    /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).