From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Doyley, Marvin M." Subject: strange behavior with org-babel python Date: Tue, 12 May 2015 01:07:25 +0000 Message-ID: <801AAE40-718A-46D4-A16D-5A0BEDB510ED@ur.rochester.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys06G-0007MQ-Ky for emacs-orgmode@gnu.org; Mon, 11 May 2015 22:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys06B-0004cF-LY for emacs-orgmode@gnu.org; Mon, 11 May 2015 22:39:16 -0400 Received: from mail-bn1bon0140.outbound.protection.outlook.com ([157.56.111.140]:32701 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys06B-0004c2-HH for emacs-orgmode@gnu.org; Mon, 11 May 2015 22:39:11 -0400 Content-Language: en-US Content-ID: <1A00B76FB66C5544B01C7E20B056B6AD@namprd07.prod.outlook.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" Hi there, If run the follow codes I get the following, could someone explain to me wh= at is going wrong (1) The desired results #+BEGIN_SRC python :results output :exports both :session x=3D5 def foo(x): if x>0: return x+1 else: return x-1 print(foo(x)) #+END_SRC #+RESULTS: : 6 (2) No results #+BEGIN_SRC python :results output raw :exports both=20 x=3D5 if x>0: x=3D x+1 else: x=3D x-1 print(x) #+END_SRC #+RESULTS: (3) Not sure, why I get this error #+BEGIN_SRC python :results output raw :exports both :session x=3D5 if x>0: x=3D x+1 else: x=3D x-1 print(x) #+END_SRC #+RESULTS: >>> >>> >>> >>> ... ... File "", line 3 else: ^ IndentationError: unindent does not match any outer indentation level If you want to paste code into IPython, try the %paste and %cpaste magic fu= nctions. Thanks, M PS in .emacs, I have (setq org-babel-python-command "ipython --no-banner --= classic --no-confirm-exit")