Skip to content
Turn Python scripts into handouts with Markdown and figures
Python CSS JavaScript
Branch: master
Clone or download
Latest commit e0d672e Aug 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
handout Make parent directories. Aug 16, 2019
.gitignore Allow setting the HTML title of the document (#14) Aug 8, 2019
LICENSE Add Apache 2 license. Nov 24, 2018 Clarify syntax for Markdown cells. Aug 15, 2019 Add online version of MathJax. Aug 15, 2019 Make parent directories. Aug 16, 2019

Python Handout


Turn Python scripts into handouts with Markdown comments and inline figures. An alternative to Jupyter notebooks without hidden state that supports any text editor.

Code Handout
Code Handout

Getting started

You use Python Handout as a library inside a normal Python program:

  1. Install via pip3 install -U handout.
  2. Run your script via python3 (You can start with the from the repository.)
  3. Open output/index.html in your browser to view the result.
  4. Iterate and refresh your browser.


Create the handout via doc = handout.Handout(outdir) to access these features:

Feature Example
Add Markdown text as triple-quote comments. """Markdown text"""
Add text via print() syntax. doc.add_text('text:', variable)
Add image from array or url. doc.add_image(image, 'png', width=1)
Add video from array or url. doc.add_video(video, 'gif', fps=30, width=1)
Add matplotlib figure. doc.add_figure(fig, width=1)
Add custom HTML. doc.add_html(string)
Insert added items and save to <outdir>/index.html.


Feel free to create an issue on Github.

You can’t perform that action at this time.