Re: How to associate a code block to another one so that it is executed beforehand?

2021-02-15 Thread Rodrigo Morales
John Kitchin writes: > Here is one way to do it. You use a :var to "run" the other block. Thank you very much for the suggestion. It indeed works but I think that I don't need what I was requesting now that I've found out about the =:post= header argument.e After reading your answer, I

Re: How to associate a code block to another one so that it is executed beforehand?

2021-02-15 Thread John Kitchin
Here is one way to do it. You use a :var to "run" the other block. #+NAME: create-file #+begin_src bash :results silent cat << EOF > main.txt foo bar EOF #+end_src #+BEGIN_SRC python :var run=create-file with open('main.txt') as f: print(f.read()) #+END_SRC #+RESULTS: : foo : bar : John

How to associate a code block to another one so that it is executed beforehand?

2021-02-15 Thread Rodrigo Morales
Is it possible to associate a code block (A) to another code block (B) so that when (A) is executed (B) is executed beforehand? I'm asking this because I have a bash code block (B) that creates a file that is then processed by a python code block (A) so before executing (A) block, the file needs