Creating Buttons With TKinter - Python Tkinter GUI Tutorial #3

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • How to create buttons with TKinter and Python. In this video I'll show you how to create buttons with tKinter. Its pretty easy!
    In this series I'll show you how to create graphical user interfaces for Python with Tkinter. TKinter comes with Python already, so there's nothing to install!
    ✅ Watch The Other Videos In This Python Playlist:
    bit.ly/2UFLKgj
    ▶️ See More At:
    Codemy.com
    ✅ Join My Facebook Group:
    bit.ly/2GFmOBz
    ✅ Subscribe To My TH-cam Channel:
    bit.ly/2IGzvOR
    ▶️ Learn to Code at Codemy.com
    Take $22 off with coupon code: youtube

ความคิดเห็น • 343

  • @Codemycom
    @Codemycom  4 ปีที่แล้ว +16

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My TH-cam Channel:
    bit.ly/2UFLKgj bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @poodles Game sure thing

    • @iancheng6861
      @iancheng6861 4 ปีที่แล้ว +1

      what if the button's command is a function that requires me to send a value? I can't use the bracket cus the function will just start. How should I do it? Or if u made a video about it can u link it to me pls

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      @@iancheng6861 use lambdas...yeah I've done videos on it. command=lambda: function_name(pass stuff)

    • @iancheng6861
      @iancheng6861 4 ปีที่แล้ว

      @@Codemycom thx thx

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @@iancheng6861 sure thing

  • @hudaadnan1382
    @hudaadnan1382 4 ปีที่แล้ว +75

    Such a friendly ,smooth and clear explanation , I'm really having fun with it. Thanks a lot.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +6

      Thank you! I appreciate that!

  • @Alicia0Cramel
    @Alicia0Cramel 4 ปีที่แล้ว +40

    Thank you. I really like your teaching style. You come across as very friendly and patient. It makes me want to learn more from you.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +4

      Glad you're enjoying them!

  • @blazingterminator6252
    @blazingterminator6252 4 ปีที่แล้ว +60

    You're kind of like the best thing that ever happened to youtube :)

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +8

      Wow, thanks!

    • @atakheli3608
      @atakheli3608 4 ปีที่แล้ว +1

      Unleash your Tech bruh, no need to use foul language

    • @bynishant9616
      @bynishant9616 4 ปีที่แล้ว +2

      @@atakheli3608 its not me my bro he has no idea how to code in python then he learns from TH-cam but makes slightest of mistakes and does this shit from my account

    • @atakheli3608
      @atakheli3608 4 ปีที่แล้ว

      Unleash your Tech oh ok, hopefully he he gets better at code

    • @bynishant9616
      @bynishant9616 4 ปีที่แล้ว

      @@atakheli3608 he just made tic tac toe its on the App Store I helped him a lot but yah

  • @mrbooscloos2431
    @mrbooscloos2431 3 ปีที่แล้ว +4

    I just started with Tkinter today and i already know how to make a button. Good video and i think its the best explanation i've seen so far!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Good job, keep it up! :-)

  • @zipeverything4367
    @zipeverything4367 4 ปีที่แล้ว +2

    I learned how to use Python GUI in just a few hours, just amazing.

  • @oreofreakshake
    @oreofreakshake 4 ปีที่แล้ว +12

    I really really appreciate your content, BIG TIME❤

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +3

      Glad you enjoy it!

  • @Revampgaming
    @Revampgaming ปีที่แล้ว +2

    really liked the way you teaching this, when i am not broke and have extra time i will surely check out your courses.

  • @ashrsfsiliman452
    @ashrsfsiliman452 3 ปีที่แล้ว +2

    Great job deserving of thanks
    عمل رائع يستحق الشكر

    • @IGCSENERD-up6yv
      @IGCSENERD-up6yv 4 หลายเดือนก่อน

      انا اتفق معاك

  • @mindset873
    @mindset873 4 ปีที่แล้ว +1

    Awesome lectures, even a beautiful teacher taught amazing lessons.

  • @deasan7429
    @deasan7429 3 ปีที่แล้ว +2

    Hi, thank you so much for your videos, they are really useful!
    I love the way you explain everything.
    I found it easier to write everything in Visual Studio Code and then just "run" it from there instead of using the Windows Terminal and always typing the command.
    I like to use as many shortcuts as possible, I do like Sublime text too but since VS I find everything easier on it.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Glad you enjoy the videos :-)

  • @BillabongJim
    @BillabongJim ปีที่แล้ว

    thank you so much for replying to every comment it is so cool!

  • @catsubiston
    @catsubiston 10 หลายเดือนก่อน

    thank you for this video! im doing A personal project and I rlly want to immerse myself with GUI specifically tkinter and i already have good feeling about it, thank you

    • @Codemycom
      @Codemycom  10 หลายเดือนก่อน +1

      Glad you're enjoying it!

  • @keooklipopo4310
    @keooklipopo4310 2 ปีที่แล้ว

    Your videos are great. I love your way of teaching. Thank you so much John for providing this for free!

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      Glad you enjoy them!

  • @lemebarbosa
    @lemebarbosa 3 ปีที่แล้ว +1

    Great lessons my friend, you're a good person!!

  • @TheGeneticHouse
    @TheGeneticHouse ปีที่แล้ว

    I am exactly the person who you made this video for and who would change the color of buttons and make them bigger lol I am legally blind and starting to work on creating a customTkinter GUI for the visually impaired and a large orange send button would be very helpful :-) thanks for the info I'm going to watch all 200 and whatever videos lol I probably won't come up with a working app but you'll get watch time haha

  • @nikhilkashyap9956
    @nikhilkashyap9956 3 ปีที่แล้ว

    It very difficult in my country to get teachers like you....... I'm from India Love you sir
    thanks for this

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      You're very welcome

  • @IGCSENERD-up6yv
    @IGCSENERD-up6yv 4 หลายเดือนก่อน

    Now I am going to beat my friend's challenge! All thanks to god, then to you!

    • @Codemycom
      @Codemycom  4 หลายเดือนก่อน

      ha fun

  • @Uploader12
    @Uploader12 ปีที่แล้ว

    Sir I'm Your New Student Love From Pakistan

  • @MaiBuiXuan-hm6ud
    @MaiBuiXuan-hm6ud ปีที่แล้ว

    Really useful for my next seminar in class. Thank you

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      Happy to hear it!

  • @zsu6333
    @zsu6333 3 หลายเดือนก่อน

    You actually blew my mind 😂

    • @Codemycom
      @Codemycom  3 หลายเดือนก่อน

      glad to hear it! lol

  • @raveenhansaka8292
    @raveenhansaka8292 ปีที่แล้ว

    Cheers! For my 1st Button with you!

  • @qzorn4440
    @qzorn4440 ปีที่แล้ว

    Very interesting. I am running this on an Orange Pi-5 Debian-Bullseye 64-bit OS. Now I need to figure out how to make the OPi5 OPi.GPIO Python3 PWM pins run the servo Pan/Tilt motors? They are a little different than the Raspberry Pi4 setup. It would be cool to control the servos with some TKinter buttons. 😎 Thank you.

  • @mahmad2504
    @mahmad2504 2 หลายเดือนก่อน

    Button padx, pady are not to change size of button. They are to add extra padding around button text

    • @Codemycom
      @Codemycom  2 หลายเดือนก่อน

      which changes the size of the button. why argue semantics that are meaningless?

  • @mariano9590
    @mariano9590 2 ปีที่แล้ว

    I understood very clearly

  • @R8M3N25
    @R8M3N25 3 ปีที่แล้ว +2

    I want to add some kind of light besides a button(s) and each time the button(s) was(were) clicked the light jumps from red to green and in case an error occurs or the function couldnt be executed the light stays red. Any idea how to tackle that? Thanks a lot for the help in advance!

  • @adamwilson2345
    @adamwilson2345 3 ปีที่แล้ว

    What else can i say... thank you soooooo much. you the man.

  • @joebox9999
    @joebox9999 4 ปีที่แล้ว +1

    Great tutorial, the only thing is that the fg="blue" works fine, but bg="red" does not change the button colour. Both parameters are coma separated. I'm on Mac.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      You must have a typo...did you forget to wrap red in quotation marks or something? You can also use hex color codes.

  • @user-botlol
    @user-botlol 5 หลายเดือนก่อน +1

    thank you so much
    !!!!!

    • @Codemycom
      @Codemycom  5 หลายเดือนก่อน

      Welcome!

  • @frazza2384
    @frazza2384 2 ปีที่แล้ว

    Thanks to this I have a wall of buttons

  • @luapob1
    @luapob1 4 ปีที่แล้ว +1

    Your videso are great!! Continiues with thes god work!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Thank you so much!

  • @mbn-code
    @mbn-code 4 ปีที่แล้ว

    thanks alot this was easy and fast to learn and i feel like i have acheved somethign, thanks!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      You're welcome!

  • @Priusgorl
    @Priusgorl 4 ปีที่แล้ว +2

    When using bg to change the color it isn't working for me at all; fg works completely fine but bg doesn't change anything. Do you know why that may be happening? Appreciate the videos :)

  • @whitedinamo
    @whitedinamo 2 ปีที่แล้ว

    Lesson check. Thanks.

  • @techdiyer5290
    @techdiyer5290 3 ปีที่แล้ว +1

    Is there a video in your playlist, that goes more in depth so that i can place things in my program more accurately, maybe even click and drag things into a place... maybe using coordinates or something, then you type them in? thx

  • @cunninghamb505
    @cunninghamb505 4 ปีที่แล้ว +2

    would love to see a video on Websockets in Python via flask/dejango

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      I'm planning on doing a lot more flask videos soon

  • @NuwanSampath-fi5zr
    @NuwanSampath-fi5zr 9 หลายเดือนก่อน

    thank you for your help.❤❤😊

    • @Codemycom
      @Codemycom  9 หลายเดือนก่อน

      welcome

  • @charlesgolden9310
    @charlesgolden9310 3 ปีที่แล้ว

    This guy is seriously awesome haha

  • @muhammadzeeshan5760
    @muhammadzeeshan5760 4 ปีที่แล้ว

    I appreciate your teaching

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Glad you're enjoying it!

  • @Sukhjeetworld
    @Sukhjeetworld 3 ปีที่แล้ว

    this is a simple way to learn python .

  • @parsabahrambeik4381
    @parsabahrambeik4381 4 ปีที่แล้ว

    Hi, the videos are all good, thank you very much.

  • @madeeasy7148
    @madeeasy7148 3 ปีที่แล้ว

    loving this!

  • @abhijitjagdishprakash4104
    @abhijitjagdishprakash4104 3 ปีที่แล้ว

    You're really a magician.

  • @anumduryab8748
    @anumduryab8748 5 ปีที่แล้ว +2

    how to deal with the problem of button resizing with window resizing using grid?

    • @InSterquiliniisInvenitur
      @InSterquiliniisInvenitur 4 ปีที่แล้ว

      Are you asking how to make the window bigger while the button maintains its current size?

  • @USAisAFK
    @USAisAFK 3 ปีที่แล้ว

    thank you for these videos. very informative

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Glad you like them!

  • @paulwatterson5992
    @paulwatterson5992 2 ปีที่แล้ว

    Is there a way to increase the feedback when you click a button? When I click a button you can barely tell that you clicked it. Thank you for all your videos :-)

  • @babay-mp4bq
    @babay-mp4bq 3 ปีที่แล้ว

    this guy is rock !

  • @rodrigopharazz
    @rodrigopharazz 9 หลายเดือนก่อน

    Thank you🙏

    • @Codemycom
      @Codemycom  9 หลายเดือนก่อน

      Welcome!

  • @komeilasadollahnia1493
    @komeilasadollahnia1493 3 ปีที่แล้ว

    Best way to teach. Go on.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      glad you enjoyed it, there's almost 200 more videos on this playlist

  • @kncongnghe6205
    @kncongnghe6205 ปีที่แล้ว

    Cảm ơn bạn!

  • @aliusama7200
    @aliusama7200 3 ปีที่แล้ว

    sir thanku that ( ) guide help me alooooot thankuuu

  • @scottmoore765
    @scottmoore765 4 ปีที่แล้ว +2

    Hi Mr. Elder, thank you for these great videos. I have a problem with my code in that I can't get the background color to take effect in the button. And the button doesn't depress like it should. Otherwise, all functionality is in place.
    Also I'm running on Mac OS. Thanks for any help.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      What does your button code look like?

    • @tobiasriber3512
      @tobiasriber3512 4 ปีที่แล้ว

      @@Codemycom have the same problem. My code is:from tkinter import *
      root = Tk()
      myButton = Button(root, text="Press me", fg="blue", bg="green")
      myButton.pack()
      root.mainloop()

    • @vikramsathish1245
      @vikramsathish1245 3 ปีที่แล้ว

      i had the same issue where it doesn’t press, all you have to do is click out of the tkinter window and click back in, as for the other one i have the same issue and dont know how to fix it

  • @ittutorial1737
    @ittutorial1737 3 ปีที่แล้ว

    Great..Improve👍

  • @Christine-ne3dw
    @Christine-ne3dw 3 ปีที่แล้ว

    Thanks for the vid

  • @nakshatrasharma6218
    @nakshatrasharma6218 4 ปีที่แล้ว +1

    Can we change the shape of the button too?
    Plz help....

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Not really...you can use an image and then bind that to a click, but it's a hacky sort of thing...

  • @jakenirmal5441
    @jakenirmal5441 3 ปีที่แล้ว

    very clear explanation awesome channel, I'm gonna SUBSCRIBE! and like

  • @tor6953
    @tor6953 10 หลายเดือนก่อน

    Thank you

    • @Codemycom
      @Codemycom  10 หลายเดือนก่อน

      welcome

  • @_fluffyy1028
    @_fluffyy1028 4 ปีที่แล้ว +2

    Even when I put in the root.mainloop(), there's no feedback when I press the button. Why? (I'm on Mac btw)

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      even? You always have to put the mainloop no matter what...that has nothing to do with the button. Did you give your button a command? There's likely a typo in your code

    • @_fluffyy1028
      @_fluffyy1028 4 ปีที่แล้ว

      @@Codemycom Here's my code:
      from tkinter import *
      root = Tk()
      def click():
      label = Label(text = "You pressed me!")
      label.pack()
      button = Button(root, text = "Press me!", command = click)
      button.pack()
      root.mainloop()

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      ​@@_fluffyy1028 that code works fine. Are you using other tools than I use?

    • @Kunal-jd6hc
      @Kunal-jd6hc 3 ปีที่แล้ว

      @@_fluffyy1028write root in Label

  • @scot1711
    @scot1711 3 ปีที่แล้ว +1

    My button doesn't show any up or down state when I click on it. Im using the exact code in your buttons video, The command function works though. I'm using PyCharm on a Mac. Any ideas?

    • @scot1711
      @scot1711 3 ปีที่แล้ว

      After more testing, I needed to add "from tkinter.ttk import *" below the original "from tkinter import *". Maybe I'm running a later version?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      @@scot1711 no, version shouldn't have anything to do with it.

  • @Pablo-fo4em
    @Pablo-fo4em 4 ปีที่แล้ว +2

    Howdy partner!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Hello!

    • @Pablo-fo4em
      @Pablo-fo4em 4 ปีที่แล้ว

      @@Codemycom I was wondering if you could please make another tkinter tutorial with the new python update

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @@Pablo-fo4em what new python update?

  • @whimsicalkins5585
    @whimsicalkins5585 ปีที่แล้ว

    Hello sir, I am facing a small issue while implementing the code. I have created the click button, but when I click, the command message is printing in my terminal and not inside Tkinker window. Can you please help me which this issue.

    • @Codemycom
      @Codemycom  ปีที่แล้ว +1

      rewatch the video and follow the directions exactly. There's no way what you're saying could possibly happen unless you radically changed the code from the video.

  • @numbred7462
    @numbred7462 9 หลายเดือนก่อน

    Hello, the button works nicely but i'm facing a problem : I made it so when you click the button it makes you select a file and then it opens it. What i want is also the filePath to be stocked inside a global variable, but whenever I create a variable in the myClick function, I'm unable to reuse it outside of that function, any solution to that problem?

    • @Codemycom
      @Codemycom  9 หลายเดือนก่อน

      make it global inside that function, define it globally there

  • @adnerremy2650
    @adnerremy2650 2 ปีที่แล้ว

    Your video is very well explained.
    If I add a fews entries, then a value to each of them. How can I get each of the values and add them up?
    Here are the codes. Thanks
    from tkinter import *
    root=Tk()
    somme=0
    def add_button():
    global somme
    somme +=1
    for i in range(somme):
    lab1=Label(root, text='lab1')
    lab1.grid(row=i, column=1)
    entry1=Entry(root)
    entry1.grid(row=i, column=2)
    bouton_add=Button(root, text='Create widget', command=add_button )
    bouton_add.grid(row=5, column=0)
    root.mainloop()

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Keep watching the videos in this series, I go over all of that.

  • @slonbeskonechen8310
    @slonbeskonechen8310 3 ปีที่แล้ว

    Thank you!

  • @اماديرأمان-ر9ك
    @اماديرأمان-ر9ك 2 ปีที่แล้ว

    شكرا كثيرا perfect

  • @howimetstarwars356
    @howimetstarwars356 3 ปีที่แล้ว

    Hello Mr. John and everybody.
    First, thank u for this tutorials. And my question : "How can i add two mission to one button. I mean, How can i add two command ? This is my question. Thank from now.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +2

      Have the button command call a function, inside that function call another function

    • @prithikannan8568
      @prithikannan8568 3 ปีที่แล้ว

      @@Codemycom Hi sir, your lessons are extremely helpful. I watched many videos on youtube for Tkinter however, I was not able to understand them. Your lessons are very clear and concise. Just a query, can we bind multiple functions to one command?Thank youu:)

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      @@prithikannan8568 you can add functions inside of functions in the normal python way you call any function

  • @harleypo2tgaming591
    @harleypo2tgaming591 3 ปีที่แล้ว

    Do we have a way of aligning a text inside a button?

  • @SeanandhungenglishSean
    @SeanandhungenglishSean 4 ปีที่แล้ว

    Thank

  • @angeljimenex880
    @angeljimenex880 2 ปีที่แล้ว

    Why does 'my_click' work differently than 'my_click()'?

  • @williamroyal4923
    @williamroyal4923 3 ปีที่แล้ว

    Is the a way to put a Checkmark (ALT 0252) on the button?

  • @lameissalahi7391
    @lameissalahi7391 2 ปีที่แล้ว

    at 6:18 when you click the button it adds to the previous line, how can I make it replace it instead?
    and great teaching, thanks ^^

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      You can update anything with .config()

  • @tejas.winiii
    @tejas.winiii 2 ปีที่แล้ว

    hey, almost nothing is working when I try to change the bg color of the button-neither the hex color codes or the color names. Is there anything I might've done wrong?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Yeah, probably everything. The code must be exactly like mine...

  • @ehabsaleh3613
    @ehabsaleh3613 3 ปีที่แล้ว

    are Button, Label and others widgets classes or functions as you are saying in this video?

  • @rinchan6724
    @rinchan6724 3 ปีที่แล้ว +1

    How can we put picture in our button?
    Is that possible? 😅

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Yes. I have videos on that in the playlist

  • @loganishere4760
    @loganishere4760 2 ปีที่แล้ว

    I imagine the function call parentheses are left off because the statement command already denotes a function. Weird little quirk.

  • @КаскадКругов
    @КаскадКругов 3 ปีที่แล้ว

    Thanks. Спасибо.

  • @unusableaccount9319
    @unusableaccount9319 4 ปีที่แล้ว +1

    My button works , even though I forgot to add the root to it , can you explain why? I really don't understand what's happening.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      No clue

    • @kkrolley
      @kkrolley 3 ปีที่แล้ว

      share your code with us.

  • @sushmachandran2179
    @sushmachandran2179 3 ปีที่แล้ว

    John, do you have any guide for how to make buttons the same size/center the text? I'm having a hell of a time getting my buttons to be the same size (irrespective of the text inside), even with padx...

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      No sorry...I mean, they wouldnt be the same size because it depends on the text and always will

    • @sushmachandran2179
      @sushmachandran2179 3 ปีที่แล้ว

      @@Codemycom Okay, thanks for answering.

  • @neenadkambli3168
    @neenadkambli3168 3 ปีที่แล้ว

    how to pass parameters to the function which will execute after button click?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      use a lambda

  • @vinceantonio777
    @vinceantonio777 5 ปีที่แล้ว

    hey John, i just joined codemy and used the code here to get all the courses, however, i cant seem to find the tkinter in the list of courses? i'll just watch here while i wait for your response. Great content by the way! thanks!

    • @Codemycom
      @Codemycom  5 ปีที่แล้ว +1

      Hey Vince...the tKinter videos are exclusively on youtube.

    • @vinceantonio777
      @vinceantonio777 5 ปีที่แล้ว

      @@Codemycom Hey John! thanks for the response! i'll follow the training here then.. keep it up!

    • @Codemycom
      @Codemycom  5 ปีที่แล้ว

      @@vinceantonio777 sure thing!

  • @dell857
    @dell857 ปีที่แล้ว

    Done

  • @stefanielion04
    @stefanielion04 10 หลายเดือนก่อน

    in dutch we say y as the same as we say an egg, ei. So the joke is, if you smash an egg to a wall, the egg white and yolk will flow down. So thats the trick how i always get it xd. if you dont get it, search for the translation how we say y and egg.

    • @Codemycom
      @Codemycom  10 หลายเดือนก่อน +1

      ha!

  • @aniketkumarpandey8809
    @aniketkumarpandey8809 4 ปีที่แล้ว

    How can I create multiple buttons & assign them different commands??
    What basically is my problem that -
    I have a list wherein I have the text to be displayed on the buttons, & I want them to be displayed... And on clicking a particular button that button gets removed from the display...
    Please provide me a solution to this 🙏

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      keep watching the videos in the playlist.

  • @muhammadzeeshan5760
    @muhammadzeeshan5760 4 ปีที่แล้ว

    Thank you sir

  • @mack7963
    @mack7963 4 ปีที่แล้ว

    i have a question, i am planning to learn to program with a desktop application as my end goal, now heres the thing, for what i need this program to do it will use SVG extensively for the main interactive aspects, its going to be based on the LCARS interface which are basically single colours and very simple shapes, my question is can it be done, if you google LCARS you can see exactley what im looking at doing, i just dont want to invest a ton of time in a pointless excersise, why have i chosen to go down the SVG route, performance for one, efficiency for another and aesthetics, i hope you can answert this question.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Sorry, I don't know what any of those things are...

  • @skfungaming1308
    @skfungaming1308 3 ปีที่แล้ว

    thanks

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Welcome

    • @skfungaming1308
      @skfungaming1308 3 ปีที่แล้ว

      @@Codemycom Can you halp me in next video I write my problem into comment in next video

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      @@skfungaming1308 only if it directly relates to the next video

  • @a_22_romitbhaumik89
    @a_22_romitbhaumik89 4 ปีที่แล้ว

    Can we display an already stored variable using label. For ex:
    var = 5
    label1 = label(root, text = var)
    Will it work
    Or what if i want to display the variable and some text?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Yes it will work. But more importantly...you could have simply tried it yourself faster than it took to write this comment and wait for an answer. You can concatenate text = var + " some text" as long as they are the same data type (for instance, both strings).

    • @a_22_romitbhaumik89
      @a_22_romitbhaumik89 4 ปีที่แล้ว

      @@Codemycom thank you sir, actually I am quite new to GUI , and just watched the first three videos, so I wanted to clarify my doubts before I started to actually code, which I shall be doing shortly

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @@a_22_romitbhaumik89 cool

  • @randomquiz011
    @randomquiz011 2 ปีที่แล้ว

    I am create a flutter app using my python code, so a simple app with a button that will open the python code. can you help?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      No, I don't have any videos like that

  • @fridayfirstshowtamil5177
    @fridayfirstshowtamil5177 2 ปีที่แล้ว

    Sir why u always use git for ran the program... Instead of sublime as well

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Because that's the correct way

    • @fridayfirstshowtamil5177
      @fridayfirstshowtamil5177 2 ปีที่แล้ว

      Thanx for ur reply sir..You are doing great

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      @@fridayfirstshowtamil5177 thanks

  • @immortalkarin
    @immortalkarin 2 ปีที่แล้ว

    Love your videos! Any idea why pady doesn't work for me? It just puts space between the button and the border of the window on the y axis (padx resizes the button) and not resizing it on the y axis. Thanks!

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      that's what pady does..puts space on the y axis.

    • @immortalkarin
      @immortalkarin 2 ปีที่แล้ว

      @@Codemycom Yeh but it doesn't change the size of it, like it does for you in the video. In the video it kinda changes the heigh of it, makes it "tall", mine just puts space between the edge of the window and the edge of the button but retains the dimension of the button, the area where i can press it. It's not a big deal, but I thought it was kinda strange, maybe i'm doing something wrong on my end though.

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      @@immortalkarin Not really...continue watching the videos in the playlist. Learn more of the basics of tkinter and it'll all become clear.

    • @kovacsjony4606
      @kovacsjony4606 2 ปีที่แล้ว

      whats the difference between tkinter old version and new from 2021.?. and if it works only with print("that text") after def..

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      @@kovacsjony4606 I don't know what you mean by old version and new version. There aren't changes.

  • @texxmexxchick
    @texxmexxchick 3 ปีที่แล้ว

    cool!

  • @markgreen2170
    @markgreen2170 ปีที่แล้ว

    yes, at 8 minutes, you are not calling the function (command=myClick) you are 'passing a reference of the myClick function to command, like assigning a value to a variable...'

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      not really...you're calling the function...you're causing the function to be executed.

    • @markgreen2170
      @markgreen2170 ปีที่แล้ว +1

      @@Codemycom by the way, I like your videos and plan on working through the whole set, then I see what you have on codemy ...I'm an 'old school' c/c++ (college days...) coder trying to 'knock some rust off my skill set' thanks

  • @Hyvexx
    @Hyvexx 4 ปีที่แล้ว

    I was wondering why when I clicked the button on a Mac, the window flickers black for a second then turns to normal. I assume that this is just the window being updated, but I was wondering if there is anyway to get it to update smoothly like on windows.
    Also I can't seem to change the background color of the button and I was also wondering if that is just a system difference.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      No clue what's going on there...it should be smooth

    • @Hyvexx
      @Hyvexx 4 ปีที่แล้ว

      Codemy.com It seems that as I continued through the playlist, the flickering just stopped. Maybe it’s because the page was updating from the button being clicked and due to a system difference

  • @iancheng6861
    @iancheng6861 4 ปีที่แล้ว

    what if the button's command is a function that requires me to send a value? I can't use the bracket cus the function will just start. How should I do it? Or if u made a video about it can u link it to me pls

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      use lambdas...yeah I've done videos on it. command=lambda: function_name(pass stuff)

  • @mashedpotato5694
    @mashedpotato5694 3 ปีที่แล้ว +1

    Hey i want to pass an argument while we click a button, how to deal with that case, please help anyone

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Use a lambda, I have many videos on that in the playlist

  • @didierleprince6106
    @didierleprince6106 ปีที่แล้ว

    Merci (:

  • @mohamed-0101-i8e
    @mohamed-0101-i8e 4 ปีที่แล้ว

    you've a great video thanks for that, but i have one qs, what about if that function have arguments how can I do that ?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      use lambdas... command=lambda: function(arguments)

    • @mohamed-0101-i8e
      @mohamed-0101-i8e 4 ปีที่แล้ว

      @@Codemycom ohh thank you i've tried that and it works.
      But the thing is that idk why? Can you refer to some explanation please

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      @@mohamed-0101-i8e That's just how tkinter does it.

    • @mohamed-0101-i8e
      @mohamed-0101-i8e 4 ปีที่แล้ว

      @@Codemycom hah thanks for your help

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @@mohamed-0101-i8e sure thing

  • @avanisood6283
    @avanisood6283 4 ปีที่แล้ว

    I tried bg, but it didn't work for me. Any idea why?
    Here's my code: myButton = Button(root, text="Click Me!", command=myClick, fg="blue", bg="red")

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      It should work. try activebackground= or background= or Background=

    • @devkidgames857
      @devkidgames857 3 ปีที่แล้ว

      Try using highlightbackground=“red” instead

  • @sarnithvarun8536
    @sarnithvarun8536 3 ปีที่แล้ว

    whats up guys. its john elder... we all come for this intro lol

  • @danieljohncanedacatudio5072
    @danieljohncanedacatudio5072 ปีที่แล้ว

    here is the thing.
    I have a label on the top and two buttons below that label. I also aligned them in the middle, like in the illustration below.
    MAIN MENU
    button1
    button2
    Now, I want to give space between that label and the buttons. And this is how I want it to look.
    MAIN MENU
    button1
    button2
    But each time I add "pady=50" in button 1, the output becomes like this.
    MAIN MENU
    button1
    button2
    Anyone, is there a way to modify the distance between button1 and button2? I want to keep the distance of my button1 now, what I want now is to move button 2 closer to button1. Please help me how to do it through a python tkinter code.

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      You can pass a tuple to your pady that only gives padding on one side. so pady=(0,50) or pady=(50,0) that should do the trick.