fifo = 'pipe'
os.mkfifo(fifo)
op = os.popen('cat ' + fifo)
print >> open(fifo, 'w'), output
os.unlink(fifo)
proc = Popen(['diff', dumpfile, '--unified'], stdout=PIPE, stdin=op)
proc = Popen(['diff', last_keyframe, '-', '--unified'], stdin=PIPE, stdout=PIPE)
proc.stdin.write(output)
result = proc.communicate()[0]