Skip to content Skip to sidebar Skip to footer

How To Kill Linux Process With Python

I want to automate capturing logs from serial port with 2 functions: 1) trigger to start capture 2) trigger to stop First looks like def start_capture_output(): file = '/home/te

Solution 1:

If you spawn the process with

child = subprocess.Popen("command")

Then you can call

child.terminate()
child.kill()

Post a Comment for "How To Kill Linux Process With Python"