So I've been running this program called openpose and I run it using multiprocessing.
def openpose():
os.chdir(r'C:\Users\cubeow\OneDrive\Desktop\OpenPose\openpose-1.7.0-binaries-win64-gpu-python3.7-flir-3d_recommended\openpose')
subprocess.call(['bin\OpenPoseDemo.exe', '--write_json', r'C:\Users\cubeow\OneDrive\Desktop\OpenposeOutput', '--frame_flip'], shell=True)
def main():
run = multiprocessing.Process(name='run', target=openpose)
time.sleep(10)
run.terminate()
if __name__ == '__main__':
main()
So there's also some other code but that's not needed for this question. So if I terminate it after the openpose program starts running, it won't close the demo window. And even if I exit the demo window, it'll just pop up again. Then I used task manager to close the process. So to restate the question, how can I successfully terminate a multiprocessing function that calls a powershell command?