Introducing Python programming to a general audience

This was my attempt at introducing Python to a general audience at Tech me out at home — an online event organised by Pint of Science, Ireland.

Overall, I’m happy with the way it went, especially with the fact that I could include code samples within the presentation and demonstrate them during the talk (example slide). You can read more about it in the technical details section below, if you are interested.



After the talk, there were some interesting questions from the audience, like:

Why use Python instead of Java?
What program to use for editing Python code? etc.,

I recommended Mu as the code editor for beginners. It is what I use for my own course.

Technical details

For the online presentation, I used reveal.js. To embed code samples within the presentation I used Trinket.

These are the other programs and services I looked at before deciding on using Trinket:

Skulpt is open source. It can be configured to run in Python 3 mode. I haven’t tested this yet.

CodeSkulptor is based on Skulpt and has Python 3 support. There was no option to immediately embed it in HTML. I noticed later that it is possible to generate a New URL for each example. This URL can then be embedded in an iframe similar to Trinket.’s user interface is nice and has support for Python 3 but code can only be shared with a limited number of participants in the free version. From their website, it appears this limit has been raised temporarily to 50 due to Covid-19.

Integrating Presentation on This Website

These are the steps I used to integrate the reveal.js presentation on this website, which is built using the Pelican static site generator:

Copy slides to a new directory under content so the final path would be content/slides/pint20. Here is a zip file (4.2 MB) of my presentation if you would like to test.

Add slides directory to STATIC_PATHS:

STATIC_PATHS = ["files", "images", "slides"]

Make Pelican ignore HTML files in the slides directory. I only use Markdown for writing content, so this setting does not create any problems for me:

READERS = {"html": None}

When the website is regenerated, the presentation should be copied over to the output directory output/slides/pint20.

A Better Approach for Embedding Slides

Might be to create a Pelican template. If I managed to do that, I will update this post.