Re: [O] org-babel python eval discrepancy

2017-08-03 Thread Dushyant Juneja
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  wrote:

> 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
>>
>


Re: [O] org-babel python eval discrepancy

2017-08-03 Thread Adam Porter
Lookup "Org babel results" in Google and you should find the right
section of the manual.  You need to set the :results keyword. 




Re: [O] org-babel python eval discrepancy

2017-08-03 Thread Dov Grobgeld
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
>


[O] org-babel python eval discrepancy

2017-08-03 Thread Dushyant Juneja
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