Python 関数をスタンドアロン スクリプトに変換する合理的に自然な方法はありますか? 何かのようなもの:
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
好きではない:
script = open("script.py", "wt")
script.write("#!/usr/bin/env python")
...