Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 154 characters in body
Source Link
Lgen
  • 1.4k
  • 12
  • 19

I would like to execute a python code block andto produce new headlines (i.e. modify the current org file programmatically). If I produce raw results butwith a replace argument, the replace argument seems to be inactive in this case. For example, if I run 3 times the following code block:

#+name: test_block
#+begin_src python :results output raw replace 
print("Test""* Test")
#+end_src

the obtained result is:

#+RESULTS: test_block
* Test
* Test
* Test

And I would expect only one * Test line with the replace argument. The code works as expected if I deleteremove the raw argument (but this doesthere is a : before the headline (* test) which is not correspond to my needsa headline anymore).

I would like to execute a python code block and produce raw results but the replace argument seems to be inactive in this case. For example, if I run 3 times the following code block:

#+name: test_block
#+begin_src python :results output raw replace 
print("Test")
#+end_src

the obtained result is:

#+RESULTS: test_block
Test
Test
Test

And I would expect only one Test line with the replace argument. The code works as expected if I delete the raw argument (but this does not correspond to my needs).

I would like to execute a python code block to produce new headlines (i.e. modify the current org file programmatically). If I produce raw results with a replace argument, the replace argument seems to be inactive in this case. For example, if I run 3 times the following code block:

#+name: test_block
#+begin_src python :results output raw replace 
print("* Test")
#+end_src

the obtained result is:

#+RESULTS: test_block
* Test
* Test
* Test

And I would expect only one * Test line with the replace argument. The code works as expected if I remove the raw argument (but there is a : before the headline (* test) which is not a headline anymore).

Source Link
Lgen
  • 1.4k
  • 12
  • 19

How to replace raw code block output

I would like to execute a python code block and produce raw results but the replace argument seems to be inactive in this case. For example, if I run 3 times the following code block:

#+name: test_block
#+begin_src python :results output raw replace 
print("Test")
#+end_src

the obtained result is:

#+RESULTS: test_block
Test
Test
Test

And I would expect only one Test line with the replace argument. The code works as expected if I delete the raw argument (but this does not correspond to my needs).