Skip to content

Instantly share code, notes, and snippets.

View jhkennedy's full-sized avatar

Joseph H Kennedy jhkennedy

View GitHub Profile
import sys, marshal, functools, subprocess
child_script = """
import marshal, sys, types;
fn, args, kwargs = marshal.load(sys.stdin)
marshal.dump(
types.FunctionType(fn, globals())(*args, **kwargs),
sys.stdout)
"""