关闭传递给subprocess.Popen的文件对象是否安全?

时间:2014-01-21 16:16:27

标签: python

关闭已传递给Popen的文件对象是否安全?例如:

import subprocess

fp = open('log.txt', 'w')
args = ...
popen = subprocess.Popen(args, stdout=fp)
fp.close() # <--- Is this OK?
popen.wait()

0 个答案:

没有答案