Is there a reasonably natural way of converting python function to standalone scripts? Something like:
def f(): 
    # some long and involved computation
script = function_to_script(f) # now script is some sort of closure, 
                               # which can be run in a separate process
                               # or even shipped over the network to a 
                               # different host
and NOT like:
script = open("script.py", "wt")
script.write("#!/usr/bin/env python")
...