mtTkinter | Legacy multi-threading support | Download Utils library
kandi X-RAY | mtTkinter Summary
kandi X-RAY | mtTkinter Summary
This is the mtTkinter module written by Allen B. Taylor, originally published here. This module was originally created to fix problems in a program that was not thread-safe, but I have found it to be useful in my own programs as well. This GitHub repository is available for those who want to fork the code, but mostly I just created it to get the module on PyPI. Publishing the module on PyPI was suggested quite a while ago.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Wait for all enqueued events .
- Initialize the event queue .
- Call an event .
- Test for thread support .
- Initialize the tkinter .
- Return a _TkAttr .
- Trigger an OK button .
- Destroy the Tk .
mtTkinter Key Features
mtTkinter Examples and Code Snippets
Community Discussions
Trending Discussions on mtTkinter
QUESTION
I was adjusting this code to my needs in PyCharm where it worked well, without any exceptions and errors. When I was trying it out in Jupyter Notebook it worked, but when I closed the Tkinter window, I get the exception Exception in thread Thread-:
and the Error RuntimeError: main thread is not in main loop
.
The traceback is: line 90, in run - line 51, in do action - line 30, in try_move
I tried to find the solution, but I only found mtTkinter for Python2.
Since I am new to threading, I don't know how to solve this problem and why it is only showing in Jupyter Notebook. Is it possible that Jupyter Notebook is the source of the problem?
The code is:
...ANSWER
Answered 2022-Apr-03 at 14:21Probably all GUIs don't like to run in threads and all changes in widgets should be in main thread (but calculations still can be in separated threads)
In tkinter
you could use master.after(milliseconds, function_name)
instead of thread
and while
-loop to run code periodically - and this will works like loop but in current thread.
QUESTION
I am getting this error when I am trying to open another window from the main window tkinter window, first time it is running perfectly and also performing tasks also but after 2 times it gives this error and whole program gets crashed and get closed down without any warning , I don't know that how to handle this error in python if there is any error handling technique for this please help me on this , in my case I am just calling the other tkinter window from main tkinter window ,I have tried very hard to solve this error but it's not getting resolved as it is coming again and again , tried all the methods given in previous posts but still it's coming , I know that tkinter is not thread safe but how to handle it any ideas, I am new to this ?
...ANSWER
Answered 2020-Jun-19 at 03:06For your case, you can simply use Toplevel
instead of Tk
inside Plottingandselect()
function and no threading is required:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mtTkinter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page