Auto-loading modules in Python

Since switching to vcsh I’ve been writing more personal scripts since they’re pretty easy to ship around to each machine. Plus more things have REST APIs and python’s slumber makes it dead easy to talk to them. However I then have to make sure modules like slumber are installed since it’s not in the python standard library. This adds a level of awkwardness to the scripts in my ~/bin. While looking for something else I came across this answer on stackoverflow and it fit what I wanted to do.