Questions tagged [mainloop]
69 questions
0
votes
0 answers
Matlibplot inside of a thread alongside Tkinter
Error inside of the terminal.
/Users/aidan/Documents/GitHub/Perceptual/Threading.py:81: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.
plt.show()
2022-11-06 14:28:07.960 Python[25376:1206036] *** Terminating…
0
votes
1 answer
I Want To Create A Loop Of This Code. Like After Ending The Codes Will Start From The Beginning. Like A Loop (Python)
from time import sleep
import pyautogui
from pynput.keyboard import Key, Controller as KeyboardController
keyboard = KeyboardController()
a = "Work"
b = "Rest"
# ********** Part 1 **********
pyautogui.click(600,…

Titas
- 1
- 1
0
votes
0 answers
Tkinter using mainloop and another loop
I'm doing a project where I read info from a socket and then intend to display it on a gui using tkinter. The thing is, my read info from socket is a loop and for the gui I need another loop.
I'm pretty inexperienced with both Python and Tkinter,…

LASO
- 1
- 4
0
votes
1 answer
tkinter code after mainloop() not being executed after closing window
I need help using tkinter in python.
I want to use a while loop inside my class so that it keeps printing in the terminal the content of an entry (box1). But the problem is that if I put a loop in my class the entry wont even be created because the…
user14704299
0
votes
1 answer
There is a way to wait on a user's answer in tkinter?
I'm developing an application what have its functions set in different files.
The main file have a tkinter interface and the buttons, entrys and labels are in other file, like this:
Mainfile.py
from tkinter import *
class Program:
def…
0
votes
0 answers
Tkinter function call does not return value
I intend to collect names in lists that will be used in a program, one at a time. The function does return a list and the whole program runs once, but after I call the function UserInput with the button:
ttk.Button(root, text='Add place', command=…

L F
- 1
0
votes
1 answer
Replaying the main loop with a few changes pygame
I have been trying to make a Fangame for Undertale with pygame but i am stuck. This is my first project. I want to replay the main loop with a few changes, for example i want the knife movement to be different, but i dont know how to do it. I have…

Stijn van Schaik
- 11
- 1
0
votes
2 answers
How do I get the return from button
how do i get the return from button command
also tried without lambda doesn't work
import tkinter as tk
#value = ''
def button(e,f):
#global value
value = e.get()
f.destroy()
return value
def display(root):
value=''
f =…

Bind
- 25
- 2
0
votes
1 answer
How to Stop Tkinter Program When Using a Class
I'm using python to create a class object that controls a Tkinter window. My code looks like this:
class MyGui:
def __init__(self):
self.root = tk.Tk()
self.root.title("My Gui")
return
def…

Elliptica
- 3,928
- 3
- 37
- 68
0
votes
1 answer
Main loop doesn't exit SDL2, C++
I'm trying to do a very basic main loop with SDL2 but the window opens and I can't close it.
I've written this code:
bool open = true;
while (open = true)
{
SDL_Event event;
while (SDL_PollEvent(&event) != 0)
{
…

John
- 3
- 2
0
votes
0 answers
tkinter problem with sockets and mainloop
im working on a project for my networking class which is a 2 clients plaing 4 in a row
I have almost everything figured out but i have one major issue, i need to get data from the server and in the same time do the mainloop beacuse i need the butons…
0
votes
1 answer
When you call mainloop in tkinter, do you need to call it in the first window that will be opened?
I'm making a login system, and I called mainloop in the first window that will be opened upon starting the program. This window is the window which asks whether the user would like to login or register. Obviously, this means I can't close this…

vlthi
- 1
0
votes
0 answers
Tkinter - Tk and TOPLEVEL Window-Mainloops Conflict
i have again an issue, that i did not figured out why.. All needed code is summarized in this screenshot:
Code
The part in "pixela_brain.py" where the two print statements are, is the problem zone:
The print("Before Opening UICreateUser") is shown…

YagmurG
- 25
- 3
0
votes
0 answers
tkinter window not showing when importing from a module
I'm having issues when I import a module that contains tkinter in it.
I don't want to paste the code because it's super long and it not my problem here, I've created a module using tkinter and selenium, this one opens a web browser and take an…

leo_bttf
- 11
- 1
0
votes
0 answers
how to change tkinter widgets configure immediately in event handler
I'm a beginner and want to make a fast reading application with tkinter library.
The app consists of a Start Button and speed Entry to show the user text in the Message widget. when Start Button press, an Event handler should run and show words…

Hoo Loo
- 23
- 5