Reputation: 21
I have a python code where i am using subprocess to get output of command "which opatch" in a function which gets output as unix path to getOpatch. Once that is done, how do I close the subprocess opened using Popen. Below is the code i use for calling subprocess. Thanks in advance.
import os
import subprocess
os.environ["ORACLE_HOME"] = X
os.environ["PATH"] += os.pathsep + os.pathsep.join([X + "/OPatch"])
getOpatch = subprocess.Popen("which opatch", shell=True, stdout=subprocess.PIPE).stdout
op_path = getOpatch.read()
Upvotes: 1
Views: 3220