Python Forum
guizero repeat command
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
guizero repeat command
#1
I am new to guizero and Python in general but I'm fighting my way through it and I think I'm almost there.

Essentially, I'm making a barcode comparing app. I'm using guizero to:

-bring up a first pop-up to collect a first scan
-bring up a second pop-up to collect a second scan
-Compare them
-App turns green if they are the same, red if they are not
-Wait a little
-Clear inputs and turn app background gray again

I also have a status message to state what process it is doing

Where I am having issues is that when that sequence is done, I want it to start back at bringing up the first pop-up.

I found the repeat command but it isn't working the way I need. When I use repeat, it runs regardless of where I am in my sequence and just endlessly brings up my first pop-up. If I was writing in C, I would just wrap my command, a wait and app.display() in a while loop but that doesn't apply in Python.

What could I do to repeat my command, without a set amount of time?

Never mind. I don't know if it was the right way but I just did:
while True:
    compare()
    app.update()
    
app.display()
This works!
Reply


Messages In This Thread
guizero repeat command - by pdihawk - Sep-24-2020, 06:59 PM
RE: guizero repeat command - by deanhystad - Sep-26-2020, 03:35 PM
RE: guizero repeat command - by pdihawk - Sep-28-2020, 01:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Example of guizero ListBox jreebel 1 2,307 Oct-29-2020, 08:17 PM
Last Post: Larz60+
  Trying to clear a list automatically at certain times (guizero) reneejerden 3 2,927 Jul-26-2019, 05:13 PM
Last Post: Denni

Forum Jump:

User Panel Messages

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