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!"

你可能感兴趣的:(process)