#!/usr/bin/env python import simplejson # download from the python cheeseshop import sys, os, cgi, cgitb; cgitb.enable() funcs = simplejson.load(open("funcnames.json")) query = cgi.FieldStorage().getfirst("q", "") result = [ key for key in funcs if key.startswith(query) ] result.sort() print """Content-Type: text/html\n\n""" print simplejson.dumps(result) # vim:ft=python:ts=4:noet: