I often use python’s SimpleHTTPServer as an adhoc means for
sharing files. As it turns out it’s also a useful tool for
dynamically viewing the contents of static site generators
like Jekyll (which is what this site is built upon).
The command below is a quick way for one to spawn
a webserver that will serve the contents of the
And since python comes pre-installed
on most linux distros and on MacOSX, this is a no-nonsense
way for serving files.
No dependencies, no installation steps, it just works.
Given this, there are times however, when I wish it had just one extra piece
of functionality: the ability to route different url prefixes to
The script below patches a single function in SimpleHTTPServer’s request handler
and makes this possible without adding in any extra dependencies.
While not as convenient as the former solution, you can run this script by simply
invoking python server.py
I build computer vision software at Flickr. You can get updates on new essays by subscribing to my rss feed. Occassionally, I will send out interesting links on twitter so follow me if you like this kind stuff.