Python buttons 🛎️

  Рет қаралды 56,136

Bro Code

Bro Code

Күн бұрын

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

Пікірлер: 78
@BroCodez
@BroCodez 4 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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
@hermit-p3x
@hermit-p3x 10 ай бұрын
@@PhoenixVids123 use a hex code
@piotrkopcewicz5227
@piotrkopcewicz5227 2 жыл бұрын
great buttons tutorial, love it and love buttons !!
@AliciaThato-nd7js
@AliciaThato-nd7js Жыл бұрын
This video really helped me and I wish you can do more videos for beginners
@DogCatStudios
@DogCatStudios 4 ай бұрын
Great video! But how do I adjust the photo’s size?
@oguzhantopaloglu9442
@oguzhantopaloglu9442 4 жыл бұрын
nice one bro
@BroCodez
@BroCodez 4 жыл бұрын
thank you again Oğuzhan
@Terry_the_Cherry
@Terry_the_Cherry 6 ай бұрын
Saved my life dude. Great tutorial!
@carlitos9764
@carlitos9764 2 жыл бұрын
Hey I'm pass by Here jus to say that u is the best ever techear in python, thanks for help in this journey.
@consticgaming
@consticgaming 27 күн бұрын
what code compiler you used?
@some0nesaid777
@some0nesaid777 Жыл бұрын
Thanks for including a copy of the code.
@Adamelamine
@Adamelamine 2 жыл бұрын
drop a comment down below
@anujpradhan2901
@anujpradhan2901 2 жыл бұрын
Thanks bro 😊
@syakirar2198
@syakirar2198 2 жыл бұрын
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'.
@cream-caker_9999
@cream-caker_9999 2 жыл бұрын
This really helped me, thanks for making an up-to-date video!!!
@Kiruba12368
@Kiruba12368 Жыл бұрын
Bro is awesome 👍
@shezzammahi9136
@shezzammahi9136 3 жыл бұрын
How can we increase or decrease the size of icon???
@flxshaep632
@flxshaep632 2 жыл бұрын
Did u watch the tut
@DROR19801
@DROR19801 Жыл бұрын
amazing tutorials thanks!
@kristgrom8692
@kristgrom8692 2 жыл бұрын
Ty bro this helped me so much with my school project! Keep up the good work
@aserramy_7
@aserramy_7 Жыл бұрын
Thank you.. you helped me a lot.. but can you make a video about how to select a interpreter pls ?? 🙏🙏
@iluha_mister
@iluha_mister 8 ай бұрын
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()
@mahakbafna4494
@mahakbafna4494 3 жыл бұрын
after running the program my image is been enlarged a lot. Is there any size specification? Can you tell me the error?
@Murad_Velibekov
@Murad_Velibekov 3 жыл бұрын
is it possible to make the button toggleable?
@oximas-oe9vf
@oximas-oe9vf 2 жыл бұрын
you mean something like a check box or a radio button?
@herlambangkurniawan7338
@herlambangkurniawan7338 3 жыл бұрын
Thanks
@yeshiiinpark6827
@yeshiiinpark6827 3 жыл бұрын
Thanks!
@Amir_Plays_non_stop
@Amir_Plays_non_stop 3 жыл бұрын
COOL!
@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🤣
@SuperStarEevee
@SuperStarEevee 2 жыл бұрын
Thank you!
@TheDarkSide-s5t
@TheDarkSide-s5t Жыл бұрын
Python how to make Round Modern Button in less than 5 minutes 2023
@VenkiTotad
@VenkiTotad 2 жыл бұрын
good thank u bro
@uuhju7004
@uuhju7004 3 жыл бұрын
thanks
@erkusin
@erkusin 2 жыл бұрын
How to move the button
@Joshua_t_
@Joshua_t_ 2 жыл бұрын
cool
@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.
@lw9954
@lw9954 2 жыл бұрын
Thanks bro!
@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!
@joshblank4579
@joshblank4579 4 жыл бұрын
Thanks bro
@BroCodez
@BroCodez 4 жыл бұрын
thanks for watching Joshy
@jhassee
@jhassee 2 жыл бұрын
nice
@gabrielpons4613
@gabrielpons4613 3 жыл бұрын
thanks!
@VertitexX
@VertitexX 7 ай бұрын
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.
@doinmom1279
@doinmom1279 2 жыл бұрын
how do i make it play sounds
@doriandoesstuff
@doriandoesstuff 3 жыл бұрын
_tkinter.TclError: couldn't recognize data in image file "clock.png"
@rokkuzner
@rokkuzner 3 жыл бұрын
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!
@hydrodynamicenergy
@hydrodynamicenergy 4 жыл бұрын
I have image button how to hiden outside frame?
@koback97
@koback97 Жыл бұрын
Ty
@beingzero7541
@beingzero7541 2 жыл бұрын
Wow!
@RichardMubalama-qj4fx
@RichardMubalama-qj4fx 4 ай бұрын
Yo what should I do if i don't see the same cage for the buttom are they anythings to install
@HussainAli-sb1dv
@HussainAli-sb1dv Жыл бұрын
love u
@PeriodismoNet
@PeriodismoNet 4 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
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()
@arkamukhopadhyay2177
@arkamukhopadhyay2177 3 жыл бұрын
but that's not the comic sans font i guess?
@CyberspaceEnt
@CyberspaceEnt Жыл бұрын
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!
@PanVladyslav
@PanVladyslav Жыл бұрын
a million of thanks
@ilordepic
@ilordepic 2 жыл бұрын
W channel
@athiraanand6915
@athiraanand6915 2 жыл бұрын
Sir, can we automatically deactivate this button for 20 second after each click. After 20 second activate again Automaticaly. Please anyone help.
@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 2 жыл бұрын
It's 'Comic Sans MS'. That's why his didn't display properly.
@arctheinnovator
@arctheinnovator 2 жыл бұрын
@@prizepig Oh, thanks for telling me! :D
@goldixal9029
@goldixal9029 2 жыл бұрын
thx :)
@EissaAlahdul
@EissaAlahdul 2 жыл бұрын
شكرا
@gustavoaponte1814
@gustavoaponte1814 Жыл бұрын
meow meow moew~!
@PhoenixVids123
@PhoenixVids123 2 жыл бұрын
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!
@kristijanlazarev
@kristijanlazarev 11 ай бұрын
wild
@ryanstephen120
@ryanstephen120 Жыл бұрын
ta
@orfredymelobeltran5237
@orfredymelobeltran5237 3 жыл бұрын
thanks
@goofygoovber
@goofygoovber Жыл бұрын
cool
@NOTHING-en2ue
@NOTHING-en2ue 2 жыл бұрын
thanks
@rubenc4696
@rubenc4696 8 ай бұрын
thanks
PyGame Beginner Tutorial in Python - Adding Buttons
18:55
Coding With Russ
Рет қаралды 180 М.
Python calculator app 🖩
15:08
Bro Code
Рет қаралды 84 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Learn Python tkinter GUI buttons easy 🛎️
11:40
Bro Code
Рет қаралды 88 М.
Learn Python tkinter GUI canvases easy 🖍️
12:12
Bro Code
Рет қаралды 18 М.
Simple GUI Calculator in Python
22:51
NeuralNine
Рет қаралды 295 М.
Create Modern Buttons With Tkinter in Python | Tkinter GUI Button Design in Python
9:26
Fabio Musanni - Programming Channel
Рет қаралды 22 М.
Meme madness? | Geometry dash 2.2
8:27
Mulpan
Рет қаралды 58 М.
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 1 МЛН
Radio Buttons with TKinter - Python Tkinter GUI Tutorial #12
17:44
How to Code (almost) Any Feature
9:48
DaFluffyPotato
Рет қаралды 713 М.