Python buttons 🛎️

preview_player
Показать описание
Python tkinter button buttons GUI tutorial beginners code

#Python #tkinter #button #buttons #GUI #tutorial #beginners #code

from tkinter import *

# button = you click it, then it does stuff

count = 0

def click():
global count
count+=1
print(count)

window = Tk()

button = Button(window,
text="click me!",
command=click,
font=("Comic Sans",30),
fg="#00FF00",
bg="black",
activeforeground="#00FF00",
activebackground="black",
state=ACTIVE,
image=photo,
compound='bottom')

Рекомендации по теме
Комментарии
Автор

from tkinter import *

# button = you click it, then it does stuff

count = 0

def click():
global count
count+=1
print(count)

window = Tk()

photo = PhotoImage(file='like.png')

button = Button(window,
text="click me!",
command=click,
font=("Comic Sans", 30),
fg="#00FF00",
bg="black",
activeforeground="#00FF00",
activebackground="black",
state=ACTIVE,
image=photo,
compound='bottom')
button.pack()

window.mainloop()

BroCodez
Автор

great buttons tutorial, love it and love buttons !!

piotrkopcewicz
Автор

This really helped me, thanks for making an up-to-date video!!!

cream-caker_
Автор

This video really helped me and I wish you can do more videos for beginners

AliciaThato-ndjs
Автор

Thanks a lot for this video, very helpful. I have made a few clickable backup programs to backup video games, but it's taking up so much space. I'm gonna use this to put it all in one programm. Thanks a lot!

INGIE
Автор

Ty bro this helped me so much with my school project! Keep up the good work

kristgrom
Автор

Hey I'm pass by Here jus to say that u is the best ever techear in python, thanks for help in this journey.

carlitos
Автор

Thanks for including a copy of the code.

somenesaid
Автор

How would I make it so that the button has two modes / appearances - e.g. "selected" and "unselected"? I would like to have buttons that when you press them they are darkened so that they are "selected" and when you press them again they return to the normal appearance of "unselected". This is basically like a checkbox, but without the check. I looked at your checkbox video, but it seems the checkbox always has to be shown. I don't want that in my app.

CLyon-ccjp
Автор

Hi. Thanks for the video. I am making chess in python and I need some help. Do you maybe know how to set the background of the default button (none). Thanks!

rokkuzner
Автор

Thank god I found your video. I was having a mental breakdown and struggling until I found this. Life of a beginner programmer🤣

carlosmunoz
Автор

Thank you.. you helped me a lot.. but can you make a video about how to select a interpreter pls ??

🙏🙏

aserramy_
Автор

after running the program my image is been enlarged a lot. Is there any size specification? Can you tell me the error?

mahakbafna
Автор

Thanks so much! I did learn somthing from this video :D I was wondering can, you show how to add multiple buttons in a same window? I'm trying to create a calculator using python.

syakirar
Автор

this video has been very successful and useful for me. except for I've been unable to get the image to work any time I try. not sure what i'm doing wrong, wish I could find out so I can fix it!
thanks for the tutorial!

CyberspaceEnt
Автор

I have image button how to hiden outside frame?

hydrodynamicenergy