Python Forum
Help with infinite loops using GUI?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with infinite loops using GUI?
#1
Raspberry Pi 3 B+
Python 3.5
GuiZero

I have created a basic program in Python v3 using the Command Line that would read a temperature sensor, print the results to the screen, wait 5 seconds and do it again. This was more of a test of the sensor than anything. Works great using a while True: loop.

Now I'm moving into Python 3.5 Idle w/GuiZero and have created a simple App layout. I have a textbox on form I wish to display this same temperature information. It works great if I click a button that is linked to the code for updating the field, but how do I create a loop so this will happen automatically every 5 seconds?

It seems that if I put any kind of while True: loop in the code it keeps the GUI from loading... I know I must be doing something wrong... HELP!

Thanks!
Reply


Messages In This Thread
Help with infinite loops using GUI? - by bowdown - Dec-03-2018, 03:22 PM

Forum Jump:

User Panel Messages

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