There is a lot of information on using Python code in a Markdown document. But it all seems to be about demonstrating Python snippets, not creating good looking documents.
Can I not combine Python and Markdown in a single document, like you can with R and Markdown?
MWE:
Output some text from Python in **Markdown**:
```python
from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
clf = tree.DecisionTreeClassifier()
clf = clf.fit(iris.data, iris.target)
print(clf.predict_proba(iris.data[:1, :]))
```
Compiling this: markdown_py markdown.txt
<p>Output some text from Python in <strong>Markdown</strong>:
<code>python
from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
clf = tree.DecisionTreeClassifier()
clf = clf.fit(iris.data, iris.target)
clf.predict_proba(iris.data[:1, :])</code></p>
It displays the code (cool), but does not actually run it.
Can you not run Python code in Markdown? If not, what alternatives are there?
(Using the python-markdown package from Ubuntu.)