I am currently working on a project, that consists of two scripts. One of them continuously reads out a (JSON) file (that sometimes changes) with an endless loop (while True:) and logs changes that are made to this file to another JSON file.The second script creates a GUI (using PyQt5), that should (alongside other things) show data, that the first script wrote into the JSON file.
I tried importing and calling the GUI-Script into the parser script. That didn't work, as the program starts the GUI, then I can use it, but only progresses to parse the file when the GUI is closed.The second thing I tried was the threading module, which had the exact same result: GUI starts, parsing only starts when the GUI is quit.
What other options do I have?
This is how I tried to use threading:
import threadingthread1 = threading.Thread(target=gui.startUI(), args=("Thread-Gui",))thread1.start()thread2 = threading.Thread(target=grabber.startGrabber(), args=("Thread-Grabber",))thread2.start()