Learn Python tkinter GUI buttons easy 🛎️

Опубликовано: 01 Август 2020
на канале: Bro Code
77,937
1.8k

You guys don't need all the button.config() calls, you can place them within the constructor if you want. I like to add comments line-by-line for teaching purposes to help explain. Do what works for you.

Python Tkinter GUI button tutorial for beginners
#Python #Tkinter #GUI #button #buttons #tutorial #beginners

button = you click it, then it does stuff

from tkinter import *

count = 0

def click():
global count
count+=1
label.config(text=count)
#label2.pack()

window = Tk()
button = Button(window,text='Click me!!!')
button.config(command=click) #performs call back of function
button.config(font=('Ink Free',50,'bold'))
button.config(bg='#ff6200')
button.config(fg='#fffb1f')
button.config(activebackground='#FF0000')
button.config(activeforeground='#fffb1f')
image = PhotoImage(file='point_emoji.png')
button.config(image=image)
button.config(compound='bottom')
#button.config(state=DISABLED) #disabled button (ACTIVE/DISABLED)
label = Label(window,text=count)
label.config(font=('Monospace',50))
label.pack()
button.pack()
label2 = Label(window,image=image)
window.mainloop()


На этой странице сайта вы можете посмотреть видео онлайн Learn Python tkinter GUI buttons easy 🛎️ длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Bro Code 01 Август 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 77,937 раз и оно понравилось 1.8 тысяч зрителям. Приятного просмотра!