Questions tagged [mainloop]
69 questions
0
votes
2 answers
tkinter: how do I insert a delay between widget changes within the same handler?
I asked a similar question about two years ago when I was trying to emulate LEDs on a Tkinter canvas. The solution then was to use the canvas after() method instead of the sleep() function to introduce a delay between widget updates.
Since then, I…

johnnym
- 35
- 5
0
votes
0 answers
Python: How to remove process on background while using separate login window (tkinter)
I have got a program with GUI (Tkinter) where I want to add a login system to. I programed a login window with a several functions in a separate library Login_v1. The program and de login system works well. However, it seems that a certain process…

Lawrence
- 25
- 5
0
votes
2 answers
Pygame mainloop qiuting exception handling
Hi I am writing a simple chess program, unfortunately I have run in some unexpected problems, namely. After I added a list which keeps track of all the figures positions, I cannot close the window using the method which I till now used. which was:
…

Mark
- 131
- 9
0
votes
1 answer
Python Tkinter variable inside mainloop doesnt display unless called from outside of loop
Trying tkinter for first time. The code below has 4 print# statements. Two questions here -
1)- When executing, I expected the of flow of code would be same as print# statements but seems the flow is different . I see print2,3 first and then print1.…

DS_
- 247
- 2
- 10
0
votes
1 answer
Don't know how to apply mainloop() in my app
I have programmed a 2600 lines application which worked great when running from the IDE. Now I have created an executable via Pyinstaller and now the GUI does not start. The application starts and disappears quickly. I do not get any errors…

Lawrence
- 25
- 5
0
votes
2 answers
Using Python and Tkinter, How would I run code every loop of .mainloop()?
I have a program where I need to move an image object every time the mainloop() loops. I haven't tried doing much, mostly because I don't know where to start. I made a dummy version of my project that simulates the issue I'm having.
from tkinter…

Spell ICUP
- 45
- 1
- 6
0
votes
1 answer
How to make QEMU only return to the main loop by executing one instruction at a time?
I added -fPCI to the QEMU source file compilation option and added -shared to the final link command, so that QEMU has become a shared library that can be dynamically loaded. I started trying to understand QEMU from then on. I use dlopen to…

chmodJack
- 1
- 1
0
votes
1 answer
using lots of MainLoop using tkinter python
So I'm doing a project in school and I'm making a game with Tkinter (I know I could have used PyGame but We learned only Tkinter in school....)
My game using sockets as well and as you might know once the code is stuck on RECEIVE the whole program…

Adam
- 11
- 1
0
votes
1 answer
Basic window with Tkinter, mainloop()
I am quite new to Python and currently learning how to create basic windows using Tkinter.
The Python documentation suggests using the following code (simplified):
from tkinter import *
class Window(Frame):
def __init__(self, master):
…

plainmath
- 1
- 2
0
votes
0 answers
wxPython MainLoop() Crashes
Sometimes when I run the project my MainLoop crashes and I get an exit code. I don't know how to debug the code and see where is the line that crashes it. My project is long and has many classes so I can't copy it to here. How to find this line?

Yuval Sharon
- 159
- 8
0
votes
1 answer
python MVC, how to make the function run automatically without pressing the button?
this is simplified version of a program that I am writing, and as it is, works.
I use the last button to test to see my fiction works, and it does.
I need to make the
self.controller.show_orders
function run by itself every few seconds, instead…

fishtang
- 167
- 3
- 9
0
votes
0 answers
Why does stopping the tkinter mainloop while a callback is queued cause an error in interactive mode?
Here's a piece of code that queues a callback with Tk.after and then destroys the window before the callback can be executed:
import tkinter as tk
win = tk.Tk()
win.after(0, win.destroy)
win.after(200, lambda: None)
win.mainloop()
Running this…

Aran-Fey
- 39,665
- 11
- 104
- 149
0
votes
0 answers
Using publish-subscribe pattern for real application design
I've decided to try out some design pattern to use it further in app development, and i'd like Publisher-Subscriber pattern. I've written some common mechanism basic classes like EventDispatcher and Subscriber, tried them in work, successfully sent…

Roman Kulaha
- 55
- 1
- 5
0
votes
0 answers
Integer Parameter in mainloop()
I wanted to know about the optional integer parameter for the mainloop() function.
There is no documentation about this on python.org nor youtube.
The First Code: passing no parameters in mainloop
from tkinter import *
def fun():
global i
…

Groudon
- 26
- 3
0
votes
1 answer
Updating temperature reading in tkinter GUI
I am quite new to Python & tkinter but I have a basic GUI which just displays the temperature read from the GPIO. The only thing that I can't get to work is the temperature doesn't update.
If anyone can help, that would be…

Faz
- 63
- 11