Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Load Another Source Block Into A Python Variable In Emacs Org Mode

This is how you can work on a code block with syntax highlighting and pass it to another code block for direct output

Code

function run(argv) {
    console.log("here 1")
}

Code

print('''
<<data1>>
''')

#+begin_example

function run(argv) { console.log("here 1") }

#+end_example

If you're just using text, you can do this

The birch canoe slid on the smooth planks. Glue the sheet to the dark blue background. It's easy to tell the depth of a well. Rice is often served in round bowls. The juice of lemons makes fine punch. The box was thrown beside the parked truck.

Code

print(data)

Results

The birch canoe slid on the smooth planks.
Glue the sheet to the dark blue background.
It's easy to tell the depth of a well.
Rice is often served in round bowls.
The juice of lemons makes fine punch.
The box was thrown beside the parked truck.

This shows how you can do it with data from the end of a file (or wherever)

Code

print(end_data)

Results

this is a test
and another line

#+begin_example

this is a test and another line

#+end_example