Python tkinter setup a basic GUI 🐍

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

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

  • @BroCodez
    @BroCodez  4 года назад +44

    from tkinter import *
    window = Tk() #instantiate an instance of a window
    window.geometry("420x420")
    window.title("Bro Code first GUI program")
    icon = PhotoImage(file='logo.png')
    window.iconphoto(True,icon)
    window.config(background="#5cfcff")
    window.mainloop() #place window on computer screen, listen for events

    • @JA-ym1tc
      @JA-ym1tc Год назад +3

      couldn't recognize data in image file "h.jpg"

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

      please share nuclear launching codes for better World😊🤣

    • @irenazgaljic4000
      @irenazgaljic4000 2 дня назад

      What tool you are using

  • @kevinrussell6530
    @kevinrussell6530 Год назад +6

    You have a great, simple way of teaching. What a relief! To have this ability in this heavily tech loaded and confusing industry is priceless! Thank you!

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

    You are so awesome at explaining these things
    I can't believe you're a hidden gem in the programming world

  • @IThinkItsMe
    @IThinkItsMe 5 месяцев назад +9

    Brilliant video. Who's learning in 2024? Where's my 2024 family?

  • @RajatTiruwa-q9v
    @RajatTiruwa-q9v 28 дней назад

    Bro code you are one of the best teacher which teaches programming in the best way you can , Thanks for this playlist this will gonna help us most of the way.

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

    This guy is top of the line. So clear and logical.

  • @Kragatar
    @Kragatar Год назад +7

    "We should give our window a unique name, such as window." 😂
    Great tutorial.

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

    I love you teachings.
    I love the way you taught me Cascading Style Sheet.
    God bless you.

  • @barnaatakacs1600
    @barnaatakacs1600 4 года назад +10

    Great series, so far the best for me🔥

    • @Pjnpm
      @Pjnpm 3 года назад

      I agree

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

    thats sick this is one of the easiest tutorials of making a gui i've seen in my life

  • @Tim1Awesome
    @Tim1Awesome 11 месяцев назад +9

    if anyone having problem with the icon, tkinter doesn't accept .jpg photos, try converting the photo to .png

    • @ov3rd0se
      @ov3rd0se 11 месяцев назад +1

      i did but still, same issue

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

      @@ov3rd0se did you save the image from Google as "all files" then put .png in the title? or what did you do?

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

      Thank you

    • @ember-k6k
      @ember-k6k Месяц назад

      ​@@ov3rd0seAnd do you have any thoughts of how it can be used to use the image because I'm having the same problem with a .PNG file

    • @ember-k6k
      @ember-k6k Месяц назад

      ​@@Tim1Awesome so do I have to save and outside of a python file because I'm having the same problem I try to JPG in a PNG file I tried a couple ways of manipulating it but there hasn't been anything that has worked sorry

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

    Btw to anyone wondering why the window.iconphoto() doesn't works, try resizing the icon smaller. I resized mine to near at 800x800 pm (wasnt accurate)

  • @MrExplorer0
    @MrExplorer0 2 месяца назад

    Underrated channel. Nice explanation, and free code.

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

    So much learned from this Channel! Thank you Bro from the bottom of my heart 😊

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

    Excellent content, but most importantly, I'm loving the funky music at the end.

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

    Very good video. I learn more from you than from college. Btw for this tutorial I work in Linux Mint.

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

    The explanation is very clear, thanks

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

    Wow! Lucid explanation!! Thank you!!!

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

    thank you so much! this tutorial was really straightforward, and really helped me!

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

    nice

  • @ARPITHAAM
    @ARPITHAAM 2 дня назад

    Clear explanation 👌

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

    Great video Bro. I wish you well in your future endeavours.

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

    Great style, also great explanation.Thx.

  • @supurcartoonandmovie6605
    @supurcartoonandmovie6605 14 дней назад

    good

  • @ishmaelnaga8628
    @ishmaelnaga8628 Месяц назад

    Your the best @Bro Code 💪💪

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

    best video...i feel like im started doing something with code!

  • @Ayushsharma-ly3wt
    @Ayushsharma-ly3wt 11 месяцев назад

    bro took the master degree of explaining

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

    Muito obrigado por essa incrível explicação, de como colocar ícone ao lado do título.

  • @nidhidhanyadaneshdevadarsa533
    @nidhidhanyadaneshdevadarsa533 6 месяцев назад

    best tutorial ever i love it😃😃😃😃😃😃

  • @joyomanda375
    @joyomanda375 6 месяцев назад

    Nice & easy explanation!

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

    Really good video

  • @prdus
    @prdus 4 месяца назад +1

    "gooey"

  • @frankbeats733
    @frankbeats733 6 месяцев назад

    this is just amazing thank you so much

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

    GUI are really exciting (❁´◡`❁)

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

    superrrr coolll

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

    Wow!

  • @iron4537
    @iron4537 2 месяца назад

    i almost had a stroke because of how you pronounced GUI

  • @hayzelbula9187
    @hayzelbula9187 8 дней назад

    😊

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

    Thanks for amazing content!

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

    Thanks

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

    😇

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

    Kindly face revealed , and also add Q/A ABOUT UR LIFE AND PROGRAMMING

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

    that was my favorite colour )

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

    I enjoyed it🎉

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

    good vid

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

  • @md.moijeuddinmolla1328
    @md.moijeuddinmolla1328 Год назад

    You made it so easy bro.

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

    nice work!!

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

    شكرا

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

    Wow!

  • @anonperson-p2x
    @anonperson-p2x 11 месяцев назад

    Brooo that is some Giga Chad content! Thanks.

    • @corey-h2k
      @corey-h2k 3 месяца назад

      what dose he use to write this

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

    Very Helpful!

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

    "Ery Noice" -Jeremy Clarkson

  • @DibyajyotiSarkar-q9m
    @DibyajyotiSarkar-q9m 19 дней назад

    thanks

  • @lucyledezma709
    @lucyledezma709 4 года назад +1

    Hello Bro!!!. Thanks for the tutorial!

    • @BroCodez
      @BroCodez  4 года назад

      thank you as always Lucy

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

    Thank u

  • @tee-hee9553
    @tee-hee9553 2 года назад +3

    Hello bro code and everyone
    I need help with customize dark mode title bar in
    Tkinter.
    The only thing I know is that disable windows bar and create new but is there a way to change background color of window bar using just a simple code I mean a short one ?😟

  • @jeewonheo843
    @jeewonheo843 3 года назад +7

    I keep getting _tkinter.TclError: couldn't recognize data in image file "GUI/a.png" error. furthermore it says the version of tkinter is deprecated. I am using mac catalina btw. do you know what's the problem?

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

      Try updating python since tkinter is built-in and comes with python.

    • @SAGARSINGH-ej4rj
      @SAGARSINGH-ej4rj Год назад

      Bro type smaller case "file=" not "File="

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

      Resize it to a smaller size

    • @saycheesesun
      @saycheesesun Месяц назад

      what worked for me is to download an older version of python

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

    3:59 Nuclear launch codes😅

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

    Thanks 🙏

  • @HussainAli-sb1dv
    @HussainAli-sb1dv Год назад

    love u

  • @pianomaster212
    @pianomaster212 4 месяца назад +1

    My code isn't working. Here's my code:
    from tkinter import *
    window = Tk()
    window.geometry("420x420")
    window.mainloop()
    My error says that "Tcl" probably wasn't installed properly. Does anyone know what I did wrong?

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

    Hey Bro, how can we add .jpg images in the GUI window, can u please help me

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

      got the same problem JPG is no go for now. error _tkinter.TclError: couldn't recognize data in image

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

      @@michael3k80 I got the solution bro, i will share it with you

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

      @@dcsharma0107 would be thankful for it. Its kinda strange that such a popular type is not supported

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

      from PIL import Image, ImageTk ------> (pip install pillow)
      image = Image.open("F:\\Python Files\\My Pic.jpg")
      photo = ImageTk.PhotoImage(image)

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

    Nuclear codes^^ great just greate!

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

    Thank you sir, it's cool to do😂

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

    How open python program only into window tkinter and no to the console cmd or VSC ?

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

    Thank you Bro Code.

  • @majik725
    @majik725 2 месяца назад

    Bro, this bro is the bro

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

    BRO why am i getting this error??
    ModuleNotFoundError: No module named 'tkinter'

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

    ty

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

    Hey Bro, on Windows the icon changes inside the window object but not in the taskbar. Is there a way to change the taskbar image as well?

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

    This is amazing!

  • @ENGINEERINGSTUDENT-kk8sb
    @ENGINEERINGSTUDENT-kk8sb 2 года назад

    Thanks bro 😁

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

    Thanks bro 😅

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

    Bro love you ❤️

  • @saycheesesun
    @saycheesesun Месяц назад

    I need help whenever i try to run it the console says (That probably means that Tcl wasnt installed properly)

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

    Bros a Genius

  • @mateoreardon9868
    @mateoreardon9868 6 месяцев назад

    bros actually helpful

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

    Meow~! :3

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

    420x420 is good 😁

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

    Hmmm why the intro was soo fast? You spoke like you were in a hurry xD

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

    Nice video! :D

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

    I noticed that 420x420 bro

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

    Algorithm

  • @oximas-oe9vf
    @oximas-oe9vf 2 года назад +2

    when i puth in the line icon = PhotoImage(file = "C:\\Users\\Taghareed\\Desktop\\light bulb.gif")
    I get The error
    "couldn't recognize data in image file"
    I tried changing the file format, and it's location but it still gives me the error

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

      That's because You are not having the file named so in ur main project file

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

      U also have to make the image smaller

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

    i juste started to learn python but the window is somehow not showing up

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

    Thank you!

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

      You're welcome!

  • @Wemadeit-
    @Wemadeit- 2 года назад

    You did it east

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

    Why can't i display the image? It keeps saying file not found even tho I tried to put path and file name and neither of them worked
    Do i need to install PIL?

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

      Nvm it worked

    • @Hg31415
      @Hg31415 7 месяцев назад

      @@daniaomari7238 how?

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

      I used the relative path and it works

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

    Hello bro

  • @corey-h2k
    @corey-h2k 3 месяца назад

    what do u use to write this

  • @BlackOut-qx4jg
    @BlackOut-qx4jg 7 часов назад

    this comment is nothing just to support the channel

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

    Comment!

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

    _tkinter. TclError: couldn't recognize data in image file "qwerty.jpg". Help me please with this error 🙏

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

      U have to resize it to a smaller size,I had the same prblem

    • @Hg31415
      @Hg31415 7 месяцев назад

      did you solve it? can you help me with it?

    • @Hg31415
      @Hg31415 7 месяцев назад

      @@gamemonster9179 how do I do that?

    • @gamemonster9179
      @gamemonster9179 7 месяцев назад

      @@Hg31415 go to the file,and crop it to a smaller size,or find another one which is smaller than that pic

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

    anyone know what program hes using?

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

    what is your IDE?

    • @oximas-oe9vf
      @oximas-oe9vf 2 года назад

      bro code uses visual studio code

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

      @@oximas-oe9vf No he actually uses PyCharm

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

    ok Bro so if your listening, I'm willing to pay you to make me dangerous with this

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

    Can i use Visual Studio Code for this python code?

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

      late reply but yes

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

    bruh

  • @BEASTVERSE.07
    @BEASTVERSE.07 11 месяцев назад

    window.geometry("420×420") in not working its says this _tkinter.TclError: bad geometry specifier "420×420" , anyone can help me plz