From: Dushyant Juneja <juneja.dushyant@gmail.com>
To: Dov Grobgeld <dov.grobgeld@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-babel python eval discrepancy
Date: Thu, 03 Aug 2017 18:54:06 +0000 [thread overview]
Message-ID: <CAJkb0UNsamjaYrk6VhjVehX8Vx=niDKheEXDODm6EwoMcy5-eA@mail.gmail.com> (raw)
In-Reply-To: <CA++fsGHZXVhaN81p4BPbBoD+qH0+CwJxX9PKorJ+nxS3Low+gA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]
Hey Dov,
Bull's eye! Never realized that could hurt.
It so happened that I set the correct python version in my shell before
starting emacs. However, my bashrc file was hardwired to a different
version, which org used every time for evaluating the src blocks.
Thanks for the help!
Dushyant
On Thu, Aug 3, 2017 at 2:22 PM Dov Grobgeld <dov.grobgeld@gmail.com> wrote:
> 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 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
>>
>
[-- Attachment #2: Type: text/html, Size: 2673 bytes --]
next prev parent reply other threads:[~2017-08-03 18:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 17:31 org-babel python eval discrepancy Dushyant Juneja
2017-08-03 18:22 ` Dov Grobgeld
2017-08-03 18:54 ` Dushyant Juneja [this message]
2017-08-03 18:31 ` Adam Porter
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='CAJkb0UNsamjaYrk6VhjVehX8Vx=niDKheEXDODm6EwoMcy5-eA@mail.gmail.com' \
--to=juneja.dushyant@gmail.com \
--cc=dov.grobgeld@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).