haolz.blogg.se

Code blocks python
Code blocks python





code blocks python

RuntimeError: main thread is not in main loop Self.tk.call((self._w, 'insert', index) + elements) Self._target(*self._args, **self._kwargs)įile "C:\Users\Dave\Documents\Eclipse Workspace\Test\forum\tkinter_blocking.py", line 119, in blocking_codeįile "C:\Users\Dave\AppData\Local\Programs\Python\Python37\lib\tkinter\_init_.py", line 2806, in insert

code blocks python

Self, text='blocking task', command=self.on_button)įile "C:\Users\Dave\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_innerįile "C:\Users\Dave\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run Self.label = tk.Label(self, text='not running') You will notice that the call to change the label text to running doesn't seem work,the listbox does not update until after the sleep has finished, and the button locks in the down position. If you have ever tried to use time.sleep or any code that takes some time to run within your gui code, you will find it becomes unresponsive like in the following example.

code blocks python

(The WxPython version of this can be found here)







Code blocks python