![]() You need to put the GUI in the main thread, and use a separate thread to poll the serial port. When I google this error, I mostly get posts where people are trying to interact with the window from two different threads, but I don't think I'm doing that. RuntimeError: main thread is not in main loop # A bunch of analysis that sets either data = True or data = False based on serialdataįile "/System/Library/Frameworks/amework/Versions/2.6/lib/python2.6/threading.py", line 522, in _bootstrap_innerįile "/System/Library/Frameworks/amework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1764, in pack_configure Msg = "Data is True" if data else "Data is False" ![]() Serial = serial.Serial('dev/tty.usbmodem1d11', 9600) ![]() I tried to create a separate thread for the window that periodically gets the current data from the main thread and updates the window, like this: serialdata = I'm trying to write a program that gets data from a serial port connection and automatically updates the Tkinter window in real time based on that data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |