Это видео недоступно.
Сожалеем об этом.

Learn Python tkinter labels easy 🏷️

Поделиться
HTML-код
  • Опубликовано: 21 сен 2020
  • 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()

Комментарии • 83

  • @BroCodez
    @BroCodez  3 года назад +23

    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 года назад +1

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

  • @stickydamper
    @stickydamper 3 года назад +9

    I am confident this channel gonna explode within the next few months. Great content for beginners....

  • @ji23delgado
    @ji23delgado 3 года назад +9

    Yup, this is such a good video
    You deserve to be one of those programming youtubers at the top

  • @harlanshafer3429
    @harlanshafer3429 8 месяцев назад +1

    This lesson was really cool. And it appears to be only the beginning. Definitely two thumbs up.

  • @denisbleta5661
    @denisbleta5661 Год назад +1

    amazing tutorial, bro you're videos are helpping me with school very much thanks

  • @solomononuchefaruna5022
    @solomononuchefaruna5022 5 месяцев назад

    I am already in love with you and your teaching style. This is the best video tutorial I have watched on RUclips

  • @ThisOldMan714
    @ThisOldMan714 Год назад +1

    I have been looking for someone like you for a long time. Thank you for all of this work you have been doing.

  • @sourabhkamat8943
    @sourabhkamat8943 Год назад +1

    this is the best tutorial.. 😍😍😍😍

  • @d1jn
    @d1jn 2 года назад +2

    Thanks, simple and efficient as always.

  • @thilokasurantha2266
    @thilokasurantha2266 3 года назад +2

    VERY GOOD SERIES

  • @grass8388
    @grass8388 2 года назад +2

    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

  • @mahmouda.khalifa1377
    @mahmouda.khalifa1377 3 года назад +2

    you are so underrated keep the good work going man

    • @BroCodez
      @BroCodez  3 года назад +1

      thank you Mahmoud!

  • @kristijanlazarev
    @kristijanlazarev 5 месяцев назад

    SO COOL

  • @thaonhiangnguyen1855
    @thaonhiangnguyen1855 2 года назад +1

    Love your tutorial

  • @Leo-dw6gk
    @Leo-dw6gk 11 месяцев назад

    Thank Bro you help me alot

  • @rajansikarwar3500
    @rajansikarwar3500 8 месяцев назад

    thanks big bro

  • @Sheharyar69420
    @Sheharyar69420 9 дней назад

    Wow!

  • @orfredymelobeltran5237
    @orfredymelobeltran5237 2 года назад +1

    Thanks

  • @engr.malikiftikharahmad8751
    @engr.malikiftikharahmad8751 8 месяцев назад

    superb

  • @philtoa334
    @philtoa334 3 года назад +1

    Good.

  • @saadbinmohsin1848
    @saadbinmohsin1848 9 месяцев назад

    thanks bro

  • @lw9954
    @lw9954 Год назад +1

    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

  • @DROR19801
    @DROR19801 Год назад

    amazing tutorials thanks!

  • @uuhju7004
    @uuhju7004 3 года назад +1

    nice video

  • @adityarathi915
    @adityarathi915 9 месяцев назад

    Great information ❤❤

  • @Amir_Plays_non_stop
    @Amir_Plays_non_stop 3 года назад +1

    Just remember me when you become famous

  • @Joshua_t_
    @Joshua_t_ Год назад

    cool

  • @oliver2516
    @oliver2516 2 года назад +3

    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

  • @dhanrajhuli2931
    @dhanrajhuli2931 5 месяцев назад

    Nice tutorial

  • @HussainAli-sb1dv
    @HussainAli-sb1dv 9 месяцев назад

    love u

  • @voidgaming1402
    @voidgaming1402 Год назад

    Really good

  • @koback97
    @koback97 Год назад

    Ty

  • @jhassee
    @jhassee Год назад

    thanks a mil

  • @truquichan
    @truquichan 10 месяцев назад

    Great!

  • @user-lg5dz8sz4o
    @user-lg5dz8sz4o 10 месяцев назад

    💛

  • @sumanlamichhane369
    @sumanlamichhane369 2 года назад +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???😕😕😕😕😕😕

  • @VenkiTotad
    @VenkiTotad Год назад

    nice bro

  • @piotrkopcewicz5227
    @piotrkopcewicz5227 Год назад +1

    AWESOME!!(sorry fo shouting, i hope i wasn"t too loud)

  • @ronaldjsc1849
    @ronaldjsc1849 2 года назад +1

    I still can't figure it out how to add pictures to pycharm I'm using a Mac :/

  • @SuperStarEevee
    @SuperStarEevee 2 года назад

    Thank you!

  • @janellemcbride4364
    @janellemcbride4364 8 месяцев назад

    He has nuclear launch codes in his computer... I trust him with that information more than the government

  • @hamzazad5258
    @hamzazad5258 4 месяца назад

    well, "Hello World!"

  • @arpanshah355
    @arpanshah355 Год назад

    i dropped a comment

  • @gustavoaponte1814
    @gustavoaponte1814 Год назад

    Meow~! :3

  • @EissaAlahdul
    @EissaAlahdul Год назад

    شكرا

  • @dfg2304
    @dfg2304 2 года назад

    blabla for you bro

  • @ilordepic
    @ilordepic Год назад

    Damn thanks bro

  • @madhubabu-hq4yc
    @madhubabu-hq4yc 9 месяцев назад

    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 ?

  • @sepgorut2492
    @sepgorut2492 2 года назад +1

    For some reason my label didn't expand to the size of the text / photo

  • @Lulululu_Kitty
    @Lulululu_Kitty 2 года назад +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 года назад +1

      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

  • @arohonyinyechi-xo8vz
    @arohonyinyechi-xo8vz Год назад

    Can community pycharm import pictures

  • @abdulhayrahmonov-lw5mj
    @abdulhayrahmonov-lw5mj 8 месяцев назад

    how I can dowland phyton

  • @asgeraagaard4649
    @asgeraagaard4649 11 месяцев назад

    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

  • @chudaprasadparajuli3072
    @chudaprasadparajuli3072 3 года назад +2

    _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 года назад +6

      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.

  • @Adamelamine
    @Adamelamine 2 года назад

    drop a comment down below

  • @LimeSpeedCrystal
    @LimeSpeedCrystal Год назад

    Wait, I can't make labels!😭 Couldn't I!?

  • @Demiduce1
    @Demiduce1 Год назад

    I know this video is old, but I have a question. How do you print the label?

  • @cristiucvladimir7909
    @cristiucvladimir7909 3 месяца назад

    Bro, do you even code?

  • @NOTHING-en2ue
    @NOTHING-en2ue Год назад

    d

  • @joyedet1363
    @joyedet1363 2 года назад +1

    Bro, are you sure you know how to code?😊

  • @billgreen9168
    @billgreen9168 Год назад

    NUCLEAR LAUNCH CODES????!!!???!!!???

  • @rares_9947
    @rares_9947 2 года назад

    coment

  • @Someone_creates_animation
    @Someone_creates_animation 3 месяца назад

    Dayy1 gui

  • @AdityaVerma-vy2en
    @AdityaVerma-vy2en 6 дней назад

    Thanks

  • @beingzero7541
    @beingzero7541 2 года назад

    Wow!

  • @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 5 месяцев назад

      I have same problem, did you find a solution?

    • @paolotolentino505
      @paolotolentino505 5 месяцев назад

      @@SZAJZA1916 try switching from jpg images to PNG images

    • @SZAJZA1916
      @SZAJZA1916 5 месяцев назад

      Actually i converted my file to png and my issue was solved

  • @Someone_creates_animation
    @Someone_creates_animation 3 месяца назад

    Dayy1 gui

  • @rubenc4696
    @rubenc4696 3 месяца назад

    Thanks