Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional Button Press
#6
I wasn't able to find what you were getting at, but I figured out this problem. I made a shutdown function on the module level that changes the value of a global variable from 0 to 1. I added a conditional statement to the while loop that only lets the loop execute if the variable is set to 0. So when I push the start button it sets the variable to 0 and when I push the stop button it sets the variable to 1. After button press the loop breaks and all is well.

Cheers!
Reply


Messages In This Thread
Conditional Button Press - by Raudert - Mar-16-2017, 08:54 PM
RE: Conditional Button Press - by micseydel - Mar-16-2017, 09:10 PM
RE: Conditional Button Press - by nilamo - Mar-16-2017, 09:11 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 01:18 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 01:31 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 01:47 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 01:51 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 02:06 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 07:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to break out of a for loop on button press? philipbergwerf 6 1,852 Oct-06-2022, 03:12 PM
Last Post: philipbergwerf
  tkinter auto press button kucingkembar 2 3,277 Dec-24-2021, 01:23 PM
Last Post: kucingkembar

Forum Jump:

User Panel Messages

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