for process in psutil.process_iter():
    if process.cmdline == ['python', 'StripCore.py']:
        print('Process found. Terminating it.')
process.terminate()
break
How to terminate process from Python using pid?