In your code it should be
proc1.kill()
Both kill
or terminate
are methods of the Popen
object. On macOS and Linux, kill
sends the signal signal.SIGKILL
to the process and terminate
sends signal.SIGTERM
. On Windows they both call Windows’ TerminateProcess()
function.
More Related Contents:
- Python subprocess/Popen with a modified environment
- Popen waiting for child process even when the immediate child has terminated
- Python popen command. Wait until the command is finished
- How can I specify working directory for popen
- Calling the “source” command from subprocess.Popen
- Running a process in pythonw with Popen without a console
- Intercepting stdout of a subprocess while it is running
- Popen with conflicting executable/path
- How do I get ‘real-time’ information back from a subprocess.Popen in python (2.5)
- subprocess.Popen() error (No such file or directory) when calling command with arguments as a string
- How to write to stdout AND to log file simultaneously with Popen?
- How do I get all of the output from my .exe using subprocess and Popen?
- link several Popen commands with pipes
- Is it possible to run function in a subprocess without threading or writing a separate file/script.
- Keep a subprocess alive and keep giving it commands? Python
- Launch a shell command with in a python script, wait for the termination and return to the script
- How to get output from subprocess.Popen(). proc.stdout.readline() blocks, no data prints out
- Launch a totally independent process from Python
- real time subprocess.Popen via stdout and PIPE
- What’s the difference between subprocess Popen and call (how can I use them)?
- python subprocess Popen environment PATH?
- How do I eliminate Windows consoles from spawned processes in Python (2.7)? [duplicate]
- How can I specify working directory for a subprocess
- Bash style process substitution with Python’s Popen
- Why does subprocess.Popen() with shell=True work differently on Linux vs Windows?
- How to do multiple arguments with Python Popen?
- subprocess.wait() not waiting for Popen process to finish (when using threads)?
- Opening a process with Popen and getting the PID
- subprocess.Popen in different console
- What is the subprocess.Popen max length of the args parameter?