Урок №7: Python tkinter GUI scales

Аватар автора
Уроки программирования на русском языке
Уроки программирования на русском языке from tkinter import * def submit(): print("The temperature is: "+ str(scale.get())+ " degrees C") window = Tk() hotImage = PhotoImage(file='hot.png') hotLabel = Label(image=hotImage) hotLabel.pack() scale = Scale(window, from_=100, to=0, length=600, orient=VERTICAL, of scale font = ('Consolas',20), tickinterval = 10, numeric indicators for value = 0, current value resolution = 5, of slider troughcolor = '#69EAFF', fg = '#FF1C00', bg = '#111111' ) scale.set(((scale[¤t value of slider scale.pack() coldImage = PhotoImage(file='cold.png') coldLabel = Label(image=coldImage) coldLabel.pack() button = Button(window,text='submit',command=submit) button.pack() window.mainloop()

0/0


0/0

0/0

0/0