I'm trying to write up a code test case using org-mode and babel but can't get past the first step:
* Running code example
Set up some variables
#+begin_src python :results output :session
x=1
#+end_src
Use some variables (in the end I'll have more useful
explanatory text between the code blocks).
#+begin_src python :exports both :results output :session
print "Hi", x
#+end_src
Hitting C-c
on the blocks in sequence fails since the second block
doesn't have x
defined.
Exporting the file (to PDF if that matters) seems to execute all of the
code blocks, but the RESULTS
of the second block are not constructed
and inserted into the buffer.
How can I modify the switches on the code-blocks so that everything is executed in a session, and the results are embedded in the org buffer?
org-version=7.9.3f