Learn Python tkinter labels easy 🏷️

  Рет қаралды 35,435

Bro Code

3 жыл бұрын

Python label labels tkinter GUI code example tutorial for beginners
#Python #label #labels #tkinter #GUI #code #example #tutorial for #beginners
from tkinter import *
# label = an area widget that holds text and/or an image within a window
window = Tk()
photo = PhotoImage(file='person.png')
label = Label(window,
text="bro, do you even code?",
font=('Arial',40,'bold'),
fg='#00FF00',
bg='black',
relief=RAISED,
bd=10,
padx=20,
pady=20,
image=photo,
compound='bottom')
label.pack()
#label.place(x=0,y=0)
window.mainloop()

Пікірлер: 81
@BroCodez
@BroCodez 3 жыл бұрын
from tkinter import * # label = an area widget that holds text and/or an image within a window window = Tk() photo = PhotoImage(file='person.png') label = Label(window, text="bro, do you even code?", font=('Arial',40,'bold'), fg='#00FF00', bg='black', relief=RAISED, bd=10, padx=20, pady=20, image=photo, compound='bottom') label.pack() #label.place(x=0,y=0) window.mainloop()
@darphaprothon20
@darphaprothon20 2 жыл бұрын
raise RuntimeError(f"Too early to {what}: no default root window") RuntimeError: Too early to create image: no default root window error in line 7 (photo = PhotoImage(file='person.png'))
@ji23delgado
@ji23delgado 3 жыл бұрын
Yup, this is such a good video You deserve to be one of those programming youtubers at the top
@ThisOldMan714
@ThisOldMan714 Жыл бұрын
I have been looking for someone like you for a long time. Thank you for all of this work you have been doing.
@stickydamper
@stickydamper 3 жыл бұрын
I am confident this channel gonna explode within the next few months. Great content for beginners....
@tweenTowuuRRS
@tweenTowuuRRS 25 күн бұрын
You were right 🤧🥶
@harlanshafer3429
@harlanshafer3429 7 ай бұрын
This lesson was really cool. And it appears to be only the beginning. Definitely two thumbs up.
@solomononuchefaruna5022
@solomononuchefaruna5022 5 ай бұрын
I am already in love with you and your teaching style. This is the best video tutorial I have watched on KZbin
@grass8388
@grass8388 Жыл бұрын
Ive been trying for ages to get an image on a button and even tho u explained how to do it on a label. It was so simple I could do it on a button as well. Thanks bro
@denisbleta5661
@denisbleta5661 Жыл бұрын
amazing tutorial, bro you're videos are helpping me with school very much thanks
@d1jn
@d1jn 2 жыл бұрын
Thanks, simple and efficient as always.
@mahmouda.khalifa1377
@mahmouda.khalifa1377 3 жыл бұрын
you are so underrated keep the good work going man
@BroCodez
@BroCodez 3 жыл бұрын
thank you Mahmoud!
@thaonhiangnguyen1855
@thaonhiangnguyen1855 2 жыл бұрын
Love your tutorial
@sourabhkamat8943
@sourabhkamat8943 Жыл бұрын
this is the best tutorial.. 😍😍😍😍
@DROR19801
@DROR19801 Жыл бұрын
amazing tutorials thanks!
@dhanrajhuli2931
@dhanrajhuli2931 5 ай бұрын
Nice tutorial
@Leo-dw6gk
@Leo-dw6gk 11 ай бұрын
Thank Bro you help me alot
@truquichan
@truquichan 10 ай бұрын
Great!
@thilokasurantha2266
@thilokasurantha2266 3 жыл бұрын
VERY GOOD SERIES
@kristijanlazarev
@kristijanlazarev 5 ай бұрын
SO COOL
@SuperStarEevee
@SuperStarEevee Жыл бұрын
Thank you!
@Amir_Plays_non_stop
@Amir_Plays_non_stop 3 жыл бұрын
Just remember me when you become famous
@lw9954
@lw9954 Жыл бұрын
Bro's 2021 voice compared to his 2020 voice sounds like he put on 30 kg of muscle and truly became the gigachad as we know him today. Based
@rajansikarwar3500
@rajansikarwar3500 8 ай бұрын
thanks big bro
@beingzero7541
@beingzero7541 2 жыл бұрын
Wow!
@adityarathi915
@adityarathi915 9 ай бұрын
Great information ❤❤
@saadbinmohsin1848
@saadbinmohsin1848 9 ай бұрын
thanks bro
@engr.malikiftikharahmad8751
@engr.malikiftikharahmad8751 8 ай бұрын
superb
@orfredymelobeltran5237
@orfredymelobeltran5237 2 жыл бұрын
Thanks
@ilordepic
@ilordepic Жыл бұрын
Damn thanks bro
@koback97
@koback97 Жыл бұрын
Ty
@philtoa334
@philtoa334 3 жыл бұрын
Good.
@voidgaming1402
@voidgaming1402 Жыл бұрын
Really good
@HussainAli-sb1dv
@HussainAli-sb1dv 8 ай бұрын
love u
@EissaAlahdul
@EissaAlahdul Жыл бұрын
شكرا
@jhassee
@jhassee Жыл бұрын
thanks a mil
@VenkiTotad
@VenkiTotad Жыл бұрын
nice bro
@user-lg5dz8sz4o
@user-lg5dz8sz4o 10 ай бұрын
💛
@Joshua_t_
@Joshua_t_ Жыл бұрын
cool
@piotrkopcewicz5227
@piotrkopcewicz5227 Жыл бұрын
AWESOME!!(sorry fo shouting, i hope i wasn"t too loud)
@oliver2516
@oliver2516 2 жыл бұрын
This error always comes up in my terminal: _tkinter.TclError: couldn't recognize data in image file I've written it all over again and all the solutions on the internet are just changing the image type, which I did but it still doesn't work
@justmahsongsacc7853
@justmahsongsacc7853 Жыл бұрын
same
@uuhju7004
@uuhju7004 3 жыл бұрын
nice video
@sumanlamichhane369
@sumanlamichhane369 2 жыл бұрын
Hi there! Photo image is not working for me, IDK why? until I did this import PIL as P import PIL.ImageTk as ptk pic = "C:\filepath" buttonImage = P.Image.open(pic) buttonPhoto = ptk.PhotoImage(buttonImage) Can someone explain me why is this and why not am able to use BRO CODE for images???😕😕😕😕😕😕
@gustavoaponte1814
@gustavoaponte1814 Жыл бұрын
Meow~! :3
@arpanshah355
@arpanshah355 Жыл бұрын
i dropped a comment
@hamzazad5258
@hamzazad5258 4 ай бұрын
well, "Hello World!"
@ronaldjsc1849
@ronaldjsc1849 2 жыл бұрын
I still can't figure it out how to add pictures to pycharm I'm using a Mac :/
@janellemcbride4364
@janellemcbride4364 8 ай бұрын
He has nuclear launch codes in his computer... I trust him with that information more than the government
@sepgorut2492
@sepgorut2492 2 жыл бұрын
For some reason my label didn't expand to the size of the text / photo
@madhubabu-hq4yc
@madhubabu-hq4yc 8 ай бұрын
For me compound and image arguments are hating each other. If I use them individually they are working well , but not together. Any reason.? I am using mac Os this the reason ?
@dfg2304
@dfg2304 2 жыл бұрын
blabla for you bro
@Adamelamine
@Adamelamine 2 жыл бұрын
drop a comment down below
@asgeraagaard4649
@asgeraagaard4649 10 ай бұрын
Traceback (most recent call last): File "C:\Users\Asger\PycharmProjects\pythonProject\main.py", line 1347, in window = Tk() NameError: name 'Tk' is not defined ' WHY does this happen
@arohonyinyechi-xo8vz
@arohonyinyechi-xo8vz Жыл бұрын
Can community pycharm import pictures
@abdulhayrahmonov-lw5mj
@abdulhayrahmonov-lw5mj 8 ай бұрын
how I can dowland phyton
@LimeSpeedCrystal
@LimeSpeedCrystal Жыл бұрын
Wait, I can't make labels!😭 Couldn't I!?
@Lulululu_Kitty
@Lulululu_Kitty 2 жыл бұрын
Hi Bro, I have a problem when I try to display both text and image. After I typed in compound='bottom', both of text and image disappears and leave a blank space with the border (which I suppose is the same size as if they are still there?). I cannot figure out what going run.
@user-ux2jl5ly2f
@user-ux2jl5ly2f 2 жыл бұрын
I have the same problem. Still don't know what to do. Did you find the solution?
@Lulululu_Kitty
@Lulululu_Kitty 2 жыл бұрын
@@user-ux2jl5ly2f Not really
@jl7310
@jl7310 2 жыл бұрын
remove the "relief = RAISED," and it will work, dont know why had the same problem
@dylanwatson7331
@dylanwatson7331 Жыл бұрын
Hey there! I'm on a Mac, and it has to do with the relief option. You have five options for relief: FLAT, RAISED, SUNKEN, GROOVE, RIDGE. RAISED and SUNKEN will not work when combining both the photo and the text. GROOVE, FLAT, and RIDGE should work if you choose those options instead.
@IsraelZavala
@IsraelZavala Жыл бұрын
@@dylanwatson7331 Thank you for this comment
@Demiduce1
@Demiduce1 Жыл бұрын
I know this video is old, but I have a question. How do you print the label?
@BJChannel-vz8eb
@BJChannel-vz8eb Ай бұрын
print("label name")
@chudaprasadparajuli3072
@chudaprasadparajuli3072 3 жыл бұрын
_tkinter.TclError: couldn't recognize data in image file I got this error even after i copy and paste the same code of you and change the photo name to person.png. Please help me out on this.
@jeevanpranav6877
@jeevanpranav6877 3 жыл бұрын
i had this problem too u can solve this by installing PIL by typing "pip install Pillow" in command prompt then in your code import it as: from PIL import ImageTk, Image then where ever you use PhotoImage, you instead use ImageTk.PhotoImage() it will definetlely work. Glad to help
@chudaprasadparajuli3072
@chudaprasadparajuli3072 3 жыл бұрын
@@jeevanpranav6877 Thank's for your response bro. i find out that there should be always png image. if using other image formats you need to import and do lots of other stuffs that you've mentioned too.
@cristiucvladimir7909
@cristiucvladimir7909 2 ай бұрын
Bro, do you even code?
@joyedet1363
@joyedet1363 2 жыл бұрын
Bro, are you sure you know how to code?😊
@NOTHING-en2ue
@NOTHING-en2ue Жыл бұрын
d
@rares_9947
@rares_9947 2 жыл бұрын
coment
@billgreen9168
@billgreen9168 Жыл бұрын
NUCLEAR LAUNCH CODES????!!!???!!!???
@Someone_creates_animation
@Someone_creates_animation 2 ай бұрын
Dayy1 gui
@rubenc4696
@rubenc4696 2 ай бұрын
Thanks
@paolotolentino505
@paolotolentino505 8 ай бұрын
Traceback (most recent call last): File "C:\Users\PC\PycharmProjects\pythontutorial\adv\labels.py", line 7, in photoes = PhotoImage(file='tow.jpg') ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 4130, in __init__ Image.__init__(self, 'photo', name, cnf, master, **kw) File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 4075, in __init__ self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't recognize data in image file "tow.jpg" this happens when i try to display images why bruh
@SZAJZA1916
@SZAJZA1916 4 ай бұрын
I have same problem, did you find a solution?
@paolotolentino505
@paolotolentino505 4 ай бұрын
@@SZAJZA1916 try switching from jpg images to PNG images
@SZAJZA1916
@SZAJZA1916 4 ай бұрын
Actually i converted my file to png and my issue was solved
@Someone_creates_animation
@Someone_creates_animation 2 ай бұрын
Dayy1 gui
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 8 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
No empty
00:35
Mamasoboliha
Рет қаралды 8 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 6 МЛН
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 10 МЛН
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,2 МЛН
Это - iPhone 16 и вот что надо знать...
17:20
Overtake lab
Рет қаралды 139 М.
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 2,2 МЛН