Python buttons 🛎️

  Рет қаралды 51,565

Bro Code

3 жыл бұрын

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()
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()

Пікірлер: 76
@BroCodez
@BroCodez 3 жыл бұрын
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()
@frosty1766
@frosty1766 Жыл бұрын
how do you make it so a button disappears on click and another comes up, trying to do a golf thing where it goes through all moves per hole so displays buttons for things like hole number and clubs and saves each input for each hole
@PhoenixVids123
@PhoenixVids123 Жыл бұрын
For some reason it won't make the background of the button the colour I want, in fact, I doesn't even change it! I would like it to be blue
@user-co3bs8fm5c
@user-co3bs8fm5c 4 ай бұрын
@@PhoenixVids123 use a hex code
@piotrkopcewicz5227
@piotrkopcewicz5227 Жыл бұрын
great buttons tutorial, love it and love buttons !!
@cream-caker_9999
@cream-caker_9999 Жыл бұрын
This really helped me, thanks for making an up-to-date video!!!
@AliciaThato-nd7js
@AliciaThato-nd7js 11 ай бұрын
This video really helped me and I wish you can do more videos for beginners
@INGIE32
@INGIE32 2 жыл бұрын
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!
@PranitPandhare
@PranitPandhare 15 күн бұрын
Saved my life dude. Great tutorial!
@kristgrom8692
@kristgrom8692 Жыл бұрын
Ty bro this helped me so much with my school project! Keep up the good work
@carlitos9764
@carlitos9764 Жыл бұрын
Hey I'm pass by Here jus to say that u is the best ever techear in python, thanks for help in this journey.
@DROR19801
@DROR19801 Жыл бұрын
amazing tutorials thanks!
@some0nesaid777
@some0nesaid777 7 ай бұрын
Thanks for including a copy of the code.
@SuperStarEevee
@SuperStarEevee Жыл бұрын
Thank you!
@yeshiiinpark6827
@yeshiiinpark6827 3 жыл бұрын
Thanks!
@carlosmunoz5178
@carlosmunoz5178 2 жыл бұрын
Thank god I found your video. I was having a mental breakdown and struggling until I found this. Life of a beginner programmer🤣
@aserramy_7
@aserramy_7 10 ай бұрын
Thank you.. you helped me a lot.. but can you make a video about how to select a interpreter pls ?? 🙏🙏
@lw9954
@lw9954 Жыл бұрын
Thanks bro!
@gabrielpons4613
@gabrielpons4613 3 жыл бұрын
thanks!
@rokkuzner
@rokkuzner 2 жыл бұрын
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!
@CLyon-cc9jp
@CLyon-cc9jp Жыл бұрын
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.
@Amir_Plays_non_stop
@Amir_Plays_non_stop 3 жыл бұрын
COOL!
@syakirar2198
@syakirar2198 Жыл бұрын
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.
@gmaxnoob
@gmaxnoob Жыл бұрын
well if you want a short cut he did a video on how to make a calculater in python it's called "python calculater program'.
@anujpradhan2901
@anujpradhan2901 2 жыл бұрын
Thanks bro 😊
@Kiruba12368
@Kiruba12368 Жыл бұрын
Bro is awesome 👍
@CyberspaceEnt
@CyberspaceEnt 6 ай бұрын
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!
@beingzero7541
@beingzero7541 2 жыл бұрын
Wow!
@gamephoenix666
@gamephoenix666 Жыл бұрын
a million of thanks
@koback97
@koback97 Жыл бұрын
Ty
@goldixal9029
@goldixal9029 Жыл бұрын
thx :)
@VenkiTotad
@VenkiTotad Жыл бұрын
good thank u bro
@herlambangkurniawan7338
@herlambangkurniawan7338 2 жыл бұрын
Thanks
@uuhju7004
@uuhju7004 3 жыл бұрын
thanks
@oguzhantopaloglu9442
@oguzhantopaloglu9442 3 жыл бұрын
nice one bro
@BroCodez
@BroCodez 3 жыл бұрын
thank you again Oğuzhan
@mahakbafna4494
@mahakbafna4494 2 жыл бұрын
after running the program my image is been enlarged a lot. Is there any size specification? Can you tell me the error?
@Joshua_t_
@Joshua_t_ Жыл бұрын
cool
@ilordepic
@ilordepic Жыл бұрын
W channel
@jhassee
@jhassee Жыл бұрын
nice
@EissaAlahdul
@EissaAlahdul Жыл бұрын
شكرا
@HussainAli-sb1dv
@HussainAli-sb1dv 8 ай бұрын
love u
@joshblank4579
@joshblank4579 3 жыл бұрын
Thanks bro
@BroCodez
@BroCodez 3 жыл бұрын
thanks for watching Joshy
@user-jn2ov4pd1x
@user-jn2ov4pd1x 11 ай бұрын
Python how to make Round Modern Button in less than 5 minutes 2023
@hydrodynamicenergy
@hydrodynamicenergy 3 жыл бұрын
I have image button how to hiden outside frame?
@VertitexXOfficial
@VertitexXOfficial 2 ай бұрын
I'm trying to code this into replit python, however it isn't working and I'm stuck on trying to import Tkinter. Plus other parts are just leaving syntax errors.
@PhoenixVids123
@PhoenixVids123 Жыл бұрын
imma use this code, import pyautogui, and make it so that every time I click, it sends a message to someone saying the click number!
@BrijmohanDubge
@BrijmohanDubge 2 ай бұрын
which version is needed
@doriandoesstuff
@doriandoesstuff 2 жыл бұрын
_tkinter.TclError: couldn't recognize data in image file "clock.png"
@gustavoaponte1814
@gustavoaponte1814 Жыл бұрын
meow meow moew~!
@arctheinnovator
@arctheinnovator 2 жыл бұрын
"Let's pick a professional font such as Comic Sans." *Me: Professional?* "Very professional" "And now you can actually read what's on this button." Program: Proceeds to show a completely different font besides comic sans *I have so many questions that doesn't even have to do with the program*
@prizepig
@prizepig Жыл бұрын
It's 'Comic Sans MS'. That's why his didn't display properly.
@arctheinnovator
@arctheinnovator Жыл бұрын
@@prizepig Oh, thanks for telling me! :D
@Adamelamine
@Adamelamine 2 жыл бұрын
drop a comment down below
@kristijanlazarev
@kristijanlazarev 5 ай бұрын
wild
@Sticky_maan
@Sticky_maan 2 ай бұрын
here an button (to working) import tkinter as tk def button_clicked(): print("Button clicked!") # Create the main window root = tk.Tk() # Create a button button = tk.Button(root, text="Click me!", command=button_clicked) button.pack() # Run the Tkinter event loop root.mainloop()
@arkamukhopadhyay2177
@arkamukhopadhyay2177 3 жыл бұрын
but that's not the comic sans font i guess?
@shezzammahi9136
@shezzammahi9136 3 жыл бұрын
How can we increase or decrease the size of icon???
@flxshaep632
@flxshaep632 Жыл бұрын
Did u watch the tut
@doinmom1279
@doinmom1279 Жыл бұрын
how do i make it play sounds
@erko58
@erko58 Жыл бұрын
How to move the button
@Murad_Velibekov
@Murad_Velibekov 3 жыл бұрын
is it possible to make the button toggleable?
@oximas-oe9vf
@oximas-oe9vf Жыл бұрын
you mean something like a check box or a radio button?
@PeriodismoNet
@PeriodismoNet 3 жыл бұрын
How do i show the result of the console on the window? I need to put my code with "if, else, then" inside the gui but don't know how to do it
@arkamukhopadhyay2177
@arkamukhopadhyay2177 3 жыл бұрын
i think you need to create a label and then modify the content(text) of the label inside the function
@saiklono8503
@saiklono8503 3 жыл бұрын
you have to do it in the function
@rokkuzner
@rokkuzner 2 жыл бұрын
if you wan to do this your program shud look like this: from tkinter import * window = Tk() count = 0 def click(): global count L.config(text=str(count)) count += 1 b = Button(window, text='lalalalal', command=click) b.pack() L = Label(window, text=str(count)) L.pack() window.mainloop()
@rokkuzner
@rokkuzner 2 жыл бұрын
if you wan to do this your program shud look like this: from tkinter import * window = Tk() count = 0 def click(): global count L.config(text=str(count)) count += 1 b = Button(window, text='lalalalal', command=click) b.pack() L = Label(window, text=str(count)) L.pack() window.mainloop()
@athiraanand6915
@athiraanand6915 Жыл бұрын
Sir, can we automatically deactivate this button for 20 second after each click. After 20 second activate again Automaticaly. Please anyone help.
@ryanstephen120
@ryanstephen120 Жыл бұрын
ta
@orfredymelobeltran5237
@orfredymelobeltran5237 2 жыл бұрын
thanks
@goofygoovber
@goofygoovber Жыл бұрын
cool
@NOTHING-en2ue
@NOTHING-en2ue Жыл бұрын
thanks
@rubenc4696
@rubenc4696 2 ай бұрын
thanks
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 195 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 83 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 435 М.
Это Xiaomi Su7 Max 🤯 #xiaomi #su7max
1:01
Tynalieff Shorts
Рет қаралды 2,1 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 1,2 МЛН