Python Forum
[Tkinter] tkinter progress bar for decending number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] tkinter progress bar for decending number
Hello everyone, I'm starting an app to track weight loss and other goals. I was wondering if there is a way for the tkinter progress bar to go up when the number is going down? Like the goal weight will be set and as you lose weight the progress bar will fill till you reach your goal.I would have a current weight var and goal var. is there an option for that on tkinter or do I have to figure out some kind of math trickery lol don't really have any code to post yet, just wondering how I would go about it. I'm new so please be patient with me :)
>>> starting_weight = 225
>>> def get_progress_value(current_weight):
...     return starting_weight - current_weight
>>> for current_weight in range(225, 217, -1):
...     print(f"Current weight: {current_weight}, Progress bar value: {get_progress_value(current_weight)}")
Current weight: 225, Progress bar value: 0
Current weight: 224, Progress bar value: 1
Current weight: 223, Progress bar value: 2
Current weight: 222, Progress bar value: 3
Current weight: 221, Progress bar value: 4
Current weight: 220, Progress bar value: 5
Current weight: 219, Progress bar value: 6
Current weight: 218, Progress bar value: 7

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I measure progress and display it in the progress bar in the interface? Matgaret 2 4,186 Dec-11-2019, 03:30 PM
Last Post: Denni
  [Tkinter] Progress Bar While Sending an Email maxtimbo 3 2,003 Oct-09-2019, 09:13 PM
Last Post: woooee
  Progress Bar While Sending an Email maxtimbo 0 1,008 Oct-08-2019, 02:13 PM
Last Post: maxtimbo
  [Tkinter] Line Number Tkinter Text Are smabubakkar 1 2,891 Jun-22-2019, 07:05 PM
Last Post: woooee
  GUI Progress Bar Anysja 6 4,253 Aug-29-2018, 02:34 PM
Last Post: swetanjali
  [PyQt] cant import progress bar from another py file swipis 7 5,851 Dec-18-2016, 10:41 AM
Last Post: swipis

Forum Jump:

User Panel Messages

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