From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Burleigh Subject: Re: [Babel][BUG] Executing python code fails due to indentation error Date: Tue, 7 Sep 2010 22:11:18 -0500 Message-ID: References: <874oe1xi9f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0921483081==" Return-path: Received: from [140.186.70.92] (port=41015 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtB4D-00053r-JD for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 23:11:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtB4C-0000ij-BM for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 23:11:21 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:37833) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtB4C-0000iX-8T for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 23:11:20 -0400 Received: by iwn33 with SMTP id 33so8642827iwn.0 for ; Tue, 07 Sep 2010 20:11:18 -0700 (PDT) In-Reply-To: <874oe1xi9f.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Emacs-orgmode@gnu.org --===============0921483081== Content-Type: multipart/alternative; boundary=0050450146440a87e0048fb6de6b --0050450146440a87e0048fb6de6b Content-Type: text/plain; charset=ISO-8859-1 Youre right, without a session it works, but with a session it doesn't. Any pointers for why this wouldn't work in the shell? I really need python for On Tue, Sep 7, 2010 at 5:44 PM, Eric Schulte wrote: > 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 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 > --0050450146440a87e0048fb6de6b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Youre right, without a session it works, but with a session it doesn't.= Any pointers for why this wouldn't work in the shell? I really need py= thon for

On Tue, Sep 7, 2010 at 5:44 PM,= Eric Schulte <schulte.eric@gmail.com> wrote:
Hi Seth,

This works fine for me with external evaluation, e.g.
--8<---------------cut here---------------start------------->8---
#+begin_src python
def add(a,b):
=A0 return a+b
def sub(a,b):
=A0 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. =A0This issue would have<= br> to be resolved by the Python inferior process either python-mode or
python-shell.

Best -- Eric

Seth Burleigh <wbu= rle@gmail.com> writes:

> #+begin_src python
> def add(a,b):
> =A0 =A0return a+b
> def sub(a,b):
> =A0 =A0return a-b
> #+end_src
>
> Fails to execute due to 'unexpected indentation' in general, t= his 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-orgmo= de@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

--0050450146440a87e0048fb6de6b-- --===============0921483081== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0921483081==--