Python Forum
[Tkinter] Tkinter Aproach of UserInput Feedback
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Tkinter Aproach of UserInput Feedback
Hi There,
I wrote a simple math game for children and because i think it get´s more played by my son if there is an gui interface i try to rewrite it in python with tkinter.

I did many hours with lots of trail and error. For Some things I could need a hint and kindly ask you experts here for your aproach on some of my Problems.

The Game starts with a screen where you choose or creat your player (Done and Working)
Then Next Screen comes where you choose your Level (Done and Working)
Then next screen comes and gives you the first mathtask to solve, by pressing enter the next one comes up until all tasks are done. Everything is stored in an sql db with sql alchemy

Now I want to change this process a little:

Lets say you get 100 Tasks in this level, then you should get
4 times 25 tasks and have a little break for some TIME - so I want to have a Countdown Screen / PopUp in Between

When I created my own pop up my Programm got Stuck somehow, when the pop up got´s destroyed i´m back to the other screen but again before sending the last Enter of task 25...

And even more important i want some direct feedback for the player, like if they made a mistake i want a pop up saying wrong or something...
Or Maybee there written result should turn red and the right one should be displayed in green besides....
right now you don´t know if your calcs are right or wrong.
I prefer the display in the same window, and I don´t want the programm to stop - so if you enter the right result it turns green and the next task appears almost right away, if you did it wrong it turns red and shows the right result in green for like 1 seconde and the next task appears... and so on.

I Hope you can nelighten me with your ideas of solving such a "Problem" or Problems - they are pretty similar (more or less) - in both I dont want to user to make aditionaly user inputs.

Thanks in advance and best regards
no ideas anyone?
Would be awasome somebody could give me a hint so i can make some progress on the programm.
Thx in advance
(Nov-20-2022, 07:16 PM)RichardeRicharde Wrote: Lets say you get 100 Tasks in this level, then you should get
4 times 25 tasks and have a little break for some TIME - so I want to have a Countdown Screen / PopUp in Between

Use a Message for a popup. A countdown is a simple label that gets updated using the after() method. This program is something that demonstrates a countdown timer. The red or green "light" would be a circle on a canvas. Post code for more assistance.

import tkinter as tk

class TimedInput():
   def __init__(self): = tk.Tk()"Test of After")"200x150+10+10")

      tk.Label(, text="you have 20 seconds"
      self.lab=tk.Label(, width=3)
      self.lab.pack(side="top" )
      tk.Label(, text="--------------------"
      self.ctr = 20

      self.entry_1 = tk.Entry(, width=15)

      tk.Button(, bg="orange", text="Get Entry", 
                ).pack(side="bottom"), self.increment_counter)
   def entry_get(self):
       print("Entry is", self.entry_1.get())

   def increment_counter(self):
      self.ctr -= 1
      if self.ctr > 0:
, self.increment_counter)
          print("\n timing loop ended")

if __name__ == '__main__':
RichardeRicharde likes this post

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020