import subprocess
def my_function(x):
return x + 100
output = subprocess.Popen(my_function, 1) #I would like to pass the function object and its arguments
print output
#desired output: 101
我只找到了有关使用单独脚本打开子进程的文档。有谁知道如何传递函数对象,甚至是传递函数代码的简单方法?