From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [Babel][BUG] Executing python code fails due to indentation error Date: Tue, 07 Sep 2010 16:44:30 -0600 Message-ID: <874oe1xi9f.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=36171 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ot7Io-0004lB-0d for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 19:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ot7Im-0001rp-PO for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 19:10:09 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:47455) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot7Im-0001ob-Jl for Emacs-orgmode@gnu.org; Tue, 07 Sep 2010 19:10:08 -0400 Received: by mail-iw0-f169.google.com with SMTP id 33so8376881iwn.0 for ; Tue, 07 Sep 2010 16:10:08 -0700 (PDT) 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: Seth Burleigh Cc: Emacs-orgmode@gnu.org 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