Skip to content Skip to sidebar Skip to footer

Manually Closing Subprocess.pipe

I am using std = subprocess.PIPE and checking a particular term in every line of the output.If I get 'done', I manually kill the subprocess by os.kill : p = subprocess.Popen(['v

Solution 1:

The Popen object has a terminate method meant to do this. Could you not use this method instead?

If you really want to kill with SIGINT there is also a send_signal method.

Post a Comment for "Manually Closing Subprocess.pipe"