Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.1 KB

literate.py.md

File metadata and controls

49 lines (32 loc) · 1.1 KB

Python literate example

This is an example of Python programming, in the style promoted by Knuth called literate programming. The text is encoded using Markdown.

More about literate programming:

The program

The simplest Python program:

print("That's all Folks!")

Fancy, doensn't it?

How to evaluate?

Simply run this command in the Shell:

$ ./run-md literate.py.md 
>>> Running: literate.py.md
That's all Folks!

How to publish?

Install MarkDown processors:

MANAGER=yum
which dnf >/dev/null 2>&1 && MANAGER=dnf
which apt-get >/dev/null 2>&1 && MANAGER=apt-get
sudo $MANAGER -y install pandoc texlive

and execute make build in this directory! HTML and PDF output formats are generated. Check with any HTML browser and PDF viewer:

elinks literate.py.html
evince literate.py.pdf

That's all Folks!