Guest User

Untitled

a guest
Jan 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. (defun extract-src-content (name)
  2. (save-excursion
  3. (org-babel-goto-named-src-block name)
  4. (car (nthcdr 21 (cadr (org-element-at-point))))))
  5.  
  6. (org-element-property :value (org-element-at-point))
  7.  
  8. #+NAME: sine
  9. #+BEGIN_SRC python
  10. import math
  11.  
  12. x=math.sin(math.pi)
  13. #+END_SRC
  14.  
  15. #+BEGIN_SRC python :noweb yes :results output :exports results
  16. text="""
  17. <<sine>>
  18. """
  19. print text
  20. #+END_SRC
  21.  
  22. #+RESULTS:
  23. :
  24. : import math
  25. :
  26. : x=math.sin(math.pi)
  27. :
  28.  
  29. #+BEGIN_SRC python :noweb yes :results output :exports results
  30. text="""
  31. <<sine>>
  32. """[:-1]
  33. print text
  34. #+END_SRC
Add Comment
Please, Sign In to add comment