def do_task(fn, args_filename, result_filename):
    """Actually do the task."""
    import cPickle
    args, kw_args = cPickle.load(open(args_filename))
    result = fn(*args, **kw_args)
    cPickle.dump(result, open(result_filename, 'w'))
