From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dov Grobgeld Subject: Re: org-babel python eval discrepancy Date: Thu, 3 Aug 2017 21:22:27 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114416b27d56dc0555dd760f" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddKlT-00031D-BI for emacs-orgmode@gnu.org; Thu, 03 Aug 2017 14:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddKlS-0007zX-Gg for emacs-orgmode@gnu.org; Thu, 03 Aug 2017 14:22:31 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:38391) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddKlS-0007sI-9N for emacs-orgmode@gnu.org; Thu, 03 Aug 2017 14:22:30 -0400 Received: by mail-wm0-x22c.google.com with SMTP id m85so2227884wma.1 for ; Thu, 03 Aug 2017 11:22:28 -0700 (PDT) In-Reply-To: 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" To: Dushyant Juneja Cc: emacs-orgmode --001a114416b27d56dc0555dd760f Content-Type: text/plain; charset="UTF-8" Shell is using python3 and org-mode python2? On Aug 3, 2017 8:31 PM, "Dushyant Juneja" wrote: > Hi, > > I have the following code block in my org mode based literate programming > notes: > > #+BEGIN_SRC python > print('1+2 > 4 is ', 1+2 > 4) > print("What is 3 + 2?", 3 + 2) > #+END_SRC > > When I tangle it and run the script, it gives me expected output as > follows: > > > python notes.py > 1+2 > 4 is False > What is 3 + 2? 5 > > However, in buffer evaluation (using =C-c C-c= with cursor on src block) > gives me the following output, which seems unexpected: > > #+BEGIN_SRC python > print('1+2 > 4 is ', 1+2 > 4) > print("What is 3 + 2?", 3 + 2) > #+END_SRC > > #+RESULTS: > : ('1+2 > 4 is ', False) > : ('What is 3 + 2?', 5) > > Any hints what may be going wrong? > > Dushyant > --001a114416b27d56dc0555dd760f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Shell is using python3 and org-mode python2?

On Aug 3, 2017 8:31 PM, = "Dushyant Juneja" <juneja.dushyant@gmail.com> wrote:
Hi,

I have the f= ollowing code block in my org mode based literate programming notes:
<= div>
#+BEGIN_SRC python=C2=A0
print('1+2 > 4 is ', 1+= 2 > 4)
print("What is 3 += 2?", 3 + 2)
#+END_SRC

When I tangle it and run the script, it gi= ves me expected output as follows:

> python notes.py=C2=A0
1+2 > 4 is =C2=A0False
What is 3 + 2? 5

However, in buffer= evaluation (using =3DC-c C-c=3D with cursor on src block) gives me the fol= lowing output, which seems unexpected:

#+BEGIN_SRC python=C2=A0
print('1+2 > 4 is ', 1+2 > 4)
print("What is 3 + 2?", 3 + 2)
=
#+END_SRC

#+RESULTS:
: ('1+2 > 4 is ', False)
: ('What is 3 + 2?', 5)

Any hints what may be going wrong?
<= div>
Dushyant
--001a114416b27d56dc0555dd760f--