Hacking python's import system for single file packages

The last couple of days I have been playing around with the Kaggle Halite environment. Quickly, I ran into issues with their requirement that any agent has to be a single python file. Initially, my code was short and easy to keep self-contained. However, after adding more and more functionality, it soon became unwieldly and unintelligible. At this point, I decided to look for alternatives. In this blog post, I describe how to hack Python's import system to embed full packages into a single python module.

Read more

Table of contents


  1. 2019

  2. 2018

  3. 2017

  4. 2016

  5. 2015

  6. 2014

  7. 2013