Reputation: 431
There is a way to add R code to Markdown (Rmd) by using
```{r}
foo()
```
The result will be shown as a block of code and the output of that code (that will be calculated dynamically).
Can the same thing be done for Python or for that matter any other language?
Upvotes: 14
Views: 39273
Reputation: 696
you can simply use:
```python
your_code = do_some_stuff
```
And yes, you can do the same for a long list of languages. You can check the list of languages supported in this link: https://rdmd.readme.io/docs/code-blocks
Upvotes: 17
Reputation: 21
marky
is Markdown preprocessor allowing to execute embedded python code in Markdown documents. Documents are rendered in pdf
and html
using pandoc
. All steps are implemented in a Makefile
.
Upvotes: 2
Reputation: 858
you can embed python into .Rmd as well, see https://github.com/yihui/knitr-examples/blob/master/023-engine-python.Rmd for examples
Upvotes: 3