So in short what im trying to do is to have an arduino with leds and a gui display the information stored within a continiously updating json file(its from a game called Elite Dangerous).
So im using the watchdog to see when the file is updated and then read the new information. I would then like to use tkinter to display the information as for example: boxes changing color
However the problem is that when i use tkinter the mainloop() stops the rest of the code from running (im assuming this is because its an infinite loop). Im very new to programming still so please be genlte :P Im quite new to this site as well so please tell me if any information is missing
def main(file_path=None):
watched_dir = os.path.split(file_path)[0]
print ('watched_dir = {watched_dir}'.format(watched_dir=watched_dir)) #prints the directory
patterns = [file_path]
print ('patterns = {patterns}'.format(patterns=','.join(patterns))) #prints the file with path
event_handler = MyEventHandler(patterns=patterns)
#creating the observer and watching the file
observer = Observer()
observer.schedule(event_handler, watched_dir, recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()