Python Forum
How to change a tkinter label with scale and how to save that new value for later?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change a tkinter label with scale and how to save that new value for later?
#3
A basic example of changing label text with a slider

import tkinter as tk

root = tk.Tk()

def show(event):
    value = slider.get()
    label.config(text=f'Speed: {value}')

label = tk.Label(root, text='Speed: 0', anchor='w')
label.pack(fill='x')

slider = tk.Scale(root, from_=0, to=100, orient='horizontal', command=show)
slider.pack()

root.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
RE: How to change a tkinter label with scale and how to save that new value for later? - by menator01 - Jun-27-2024, 05:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to save to multiple locations during save cubangt 1 681 Oct-23-2023, 10:16 PM
Last Post: deanhystad
  how to open a popup window in tkinter with entry,label and button lunacy90 1 1,136 Sep-01-2023, 12:07 AM
Last Post: lunacy90
  change directory of save of python files akbarza 3 1,176 Jul-23-2023, 08:30 AM
Last Post: Gribouillis
  How to properly scale text in postscript conversion to pdf? philipbergwerf 3 1,324 Nov-07-2022, 01:30 PM
Last Post: philipbergwerf
  KeyError: 0 when trying to dedupe and match records at scale Catalytic 1 2,363 Apr-07-2022, 06:34 PM
Last Post: deanhystad
  Matplotlib scale julienhofmann 0 1,916 Apr-04-2021, 08:50 AM
Last Post: julienhofmann
  OOP Label In Tkinter Harshil 2 2,048 Aug-21-2020, 07:14 PM
Last Post: bowlofred
  Not able to update y2 axis scale in plotly ankitawadhwa 0 2,038 Jan-27-2020, 06:44 PM
Last Post: ankitawadhwa
  Change the scale on a Matplotlib Interactive Graph khatharsis 0 2,989 Oct-13-2019, 06:14 AM
Last Post: khatharsis
  How to manually define color bar scale in seaborn heatmap SriRajesh 3 18,745 Sep-08-2019, 11:12 AM
Last Post: RudraMohan

Forum Jump:

User Panel Messages

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