Python buttons 🛎️
HTML-код
- Опубликовано: 21 окт 2024
- 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()
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()
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
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
@@PhoenixVids123 use a hex code
great buttons tutorial, love it and love buttons !!
This video really helped me and I wish you can do more videos for beginners
Thanks for including a copy of the code.
Saved my life dude. Great tutorial!
Hey I'm pass by Here jus to say that u is the best ever techear in python, thanks for help in this journey.
Great video! But how do I adjust the photo’s size?
Thank you.. you helped me a lot.. but can you make a video about how to select a interpreter pls ??
🙏🙏
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.
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'.
This really helped me, thanks for making an up-to-date video!!!
amazing tutorials thanks!
Thanks bro 😊
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!
Ty bro this helped me so much with my school project! Keep up the good work
Thank god I found your video. I was having a mental breakdown and struggling until I found this. Life of a beginner programmer🤣
Thanks!
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!
thanks
Thanks
Python how to make Round Modern Button in less than 5 minutes 2023
Thank you!
nice one bro
thank you again Oğuzhan
Bro is awesome 👍
thanks!
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()
Ty
How can we increase or decrease the size of icon???
Did u watch the tut
nice
"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*
It's 'Comic Sans MS'. That's why his didn't display properly.
@@prizepig Oh, thanks for telling me! :D
cool
Thanks bro!
after running the program my image is been enlarged a lot. Is there any size specification? Can you tell me the error?
good thank u bro
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.
which version is needed
a million of thanks
Wow!
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.
COOL!
is it possible to make the button toggleable?
you mean something like a check box or a radio button?
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!
Thanks bro
thanks for watching Joshy
Yo what should I do if i don't see the same cage for the buttom are they anythings to install
but that's not the comic sans font i guess?
_tkinter.TclError: couldn't recognize data in image file "clock.png"
love u
How to move the button
thx :)
Sir, can we automatically deactivate this button for 20 second after each click. After 20 second activate again Automaticaly. Please anyone help.
I have image button how to hiden outside frame?
how do i make it play sounds
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!
شكرا
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
i think you need to create a label and then modify the content(text) of the label inside the function
you have to do it in the function
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()
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()
drop a comment down below
W channel
meow meow moew~!
wild
ta
thanks
cool
thanks
thanks