subprocess的实例不能pickle

#!/usr/bin/env python
#encoding=utf-8
from subprocess import Popen, PIPE, STDOUT
cmd = '/home/mlzboy/my/ide/test/time_sleep.py'
p = Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
print type(p)
import pickle
pickle.dump(p,open("./p.pickle","wb"))
print "done!"
原文地址:https://www.cnblogs.com/lexus/p/1831299.html