You might try looking at iPython Notebook "http://ipython.org/notebook.html". I haven't actually used it (I prefer org-mode) but according to the web site "you can combine code execution, text, mathematics, plots and rich media into a single document".