How to Embed Python Code from a Jupyter Notebook

The super easy way

February 10, 2018

Let’s not get too technical

Unless I minimize barriers to the sharing process, this blog will remain a barren wasteland. I want the simplest option amongst the many which span a large range of prerequisite TML and CSS fuss.

The Simple Process

  1. In a Jupyter Notebook, choose File, Download As, HTML
  2. Place the HTML file in your GitHub repo or webpage environment in a new folder (typically your "static" folder)
  3. In the HTML of your blog entry, add the following iframe, and experiment to set an appropriate height:

<iframe src="/some_folder/blog_sample.html" width="100%" height="200" scrolling="no" frameBorder="0"></iframe>

That’s it! You should end up with something like this: