We are using rmarkdown to produce a book on Python programming. Code chunk options like eval = TRUE
and echo = TRUE
can be used to show the nicely formatted code in the output, run it, and show the result within the text.
What would be useful, though, would be to be able to sometimes prepend the code with the Python >>>
prompt, to indicate code typed in an interactive terminal.
Is there a way to insert the >>>
prompt as a prefix?