I have a C ++ application that uses the built-in python interpreter with the Python C API. It can evaluate Python files and source code using PyRun_SimpleFile and PyObject_CallMethod.
Now I have the python source code that has a processed thread that subclasses threading.Thread and has a simple re-implementation of the run:
import time
from threading import Thread
class MyThread(Thread):
def __init__(self):
Thread.__init__(self)
def run(self):
while True:
print "running..."
time.sleep(0.2)
The problem is that the “run” is printed only once in the console.
How can I make sure that python threads continue to work in parallel with my C ++ application GUI circuit.
Thanks in advance,
Floor
source
share