A picture of me.

Tom Hodson

Maker, Baker Programmer Reformed Physicist RSE@ECMWF


A little REPL in every blog post

On this excellent personal site I saw Klipse, a little js library that lets you modify and execute code snippets in blogs. How cute!

1print("Hello, world!")

There’s even a build of python (with the magic of WASM) that includes numpy and pandas!

1import numpy as np
2import pandas as pd
3
4np.arange(12).reshape(3,-1)

The cells (of a single language) all use the same interpreter so you can share variables across. However this doesn’t seem to work when the page first loads.

1import numpy as np
2import pandas as pd
3
4a = np.arange(12).reshape(3,-1)
5df = pd.DataFrame({"zero" : a[0], "one" : a[2], "twp" : a[2]})
6df

Hopefully in future this could also hook into the nice html output that many libraries like pandas can produce!