I have an org-mode file, with org-mode version 9+ (so my understanding is that Babel should be integrated). Then I have the following in the file
#+BEGIN_SRC python :exports both :results output
return 7 + 7
#+END_SRC
#+RESULTS:
I then compile to a PDF file. My understanding is that this should display both the codeblock and the evaluation of the codeblock. However the PDF just displays:
return 7 + 7
I have tried using print
instead of return, but same outcome. What am I misunderstanding here?
return
is only used in a function – manandearth Dec 12 '18 at 22:17print
as well, which would have worked with:results output
, as that reads from the stdout stream – Ed Prince Dec 12 '18 at 22:197 + 7
on its own? – manandearth Dec 12 '18 at 22:23init.el
file and load the language in there. Posted the answer below – Ed Prince Dec 12 '18 at 22:25