I have a python script that constantly runs in the background and writes it's output to a file, I have initialized it using Python.h class in c++. I want to read from the file when the user make an action, therefore i need to somehow pause or stop the python script.
I would like to know if there is a way of sending c++ pointers to the python function and stopping the script by changing the object in the c++ code. Or maybe force the script to stop. Thanks, Ori.
system("pkill -f name-of-the-python-script");
in the c++ program. sys.exit()
but don't forget to import sys
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.