Dec-03-2018, 03:22 PM
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!
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!