Calculator with GUI Using Python Tkinter (Less Than 200 lines of Code)

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

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

  • @SarasaYugantha
    @SarasaYugantha 3 года назад +12

    One of most underrated guys on the youtube you deserve 10mviews for your amazing tutorials....

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

      10 views?🙄

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

      @@graphixig 10m what i should say my bad

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

      Please make more tutorials with designing programs not only python c++ c# php swift things like plz

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

      i learned python for 3months but your this video literally get to me know python

  • @Jdeadevil
    @Jdeadevil 2 года назад +4

    I give up, it's really hard to follow along with this because of how convoluted this is compared to every other Tkinter tutorial I've watched. That would be fine, but I'm about half way through, and I've got this problem I cannot figure out, but I have no chance of figuring this out because all the comments are just "I'm going to do this" which has given me no point of reference. This is like more of a video you'd put in your portfolio to prove you're already a genius.

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

      Trust me, I have been coding for years, and the only way to learn is to get your hands dirty, and sweat and blood, trials and errors, these tutorials are not going to teach you anything, find some website enrol, take few courses and seek projects, and build projects, preferably with a tutor “hence” tutorial. These guys are here to show off, "look what we can do", and believe me, you need to understand the very basics first, and the concepts, all of the functions and methods are secondary, you will learn them in time and nobody knows all the functions, but you need to know what you’re about to create then look for the right tools to build it, but you need to know how to use those tools. That’s all there is to it.
      Start learning to code, 20 minutes every day and in three months you will learn to do many things all by yourself.
      My advice is start learning to use python, C++, JavaScript, etc… and using tkinter, kivy will only teach you how to code with tkinter and kivy, and then if you’re forced to use real coding, you will find yourself stranded in the middle of nowhere.

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

      There is no genius, you learn to code like you learn to drive a car, to ride a bike, to play the piano, guitar, or to learn to speak another language the key is practice that’s all, no genius there.

    • @David-fq5un
      @David-fq5un 7 месяцев назад +1

      Yes, it would be nice if he explained more why he is doing things, but I've followed along and it is working. Use your brain and try to think what is happening. Use pencil and paper to go through some of the steps if it helps.

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

    Thanks for your Video and all your explanation, have a good week-end Man!

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

    I literally found this on git while browsing lol it's a cool programme.
    I have my own calculator code on git but it doesn't have any GUI just basic calculations on a good old terminal

  • @devadathr6840
    @devadathr6840 3 года назад +20

    Very useful video. Absolutely advanced and short but still highly effective. Expect more contents from you. I'm new to this Object Oriented Programming. So would like to have some lessons from you. Also I request you to make video on a python GUI Dictionary and a GUI Address/Contact Book. It will be so helpful if it's so. 😍😍

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

    Whats your theme? looks amazing

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

    Much better than copying to intense music. Tysm.

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

    His razer laptop background matches with the programming language he uses

  • @David-fq5un
    @David-fq5un 7 месяцев назад

    Good video overall. Need more explanation why you coded it a certain way or what the code does, not just give the code.

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

    Thanks for the tutorial, it helps me a lot, I learnt a lot with this video. You're doing a great job ! I was writing some python code before but never with gui, now I want to learn more from tkinter !!

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

    Thank you so much. can you recommend us a package to test the calculator GUI or any vid that can help us write Calculator GUI?

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

    Thank you so much for this amazing video! I really learnt so much things from you and your my favorite youtuber

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

    came here from your website......awesome youtube channel like your website.......keep uploading good stuff like this...thanks

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

    but I wanna ask one thing that
    i am getting error
    ". calculator has no attribute create_display_frame()
    so can you tell me it's fix?

  • @Lily-fc5li
    @Lily-fc5li 2 года назад

    thank you , I had so much fun while coding!

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

    sir can you also make a video
    while i typing a number in the entry widget the number must separate in thousand for example
    if i'm typing 1200 it must separate 1,200

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

    You were great at explaining

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

    Is there an exercise to make this calculator?

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

    I FOUND IT!!!! THANK U SO MUH JIIII.......

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

    What if you want to add trigonometrical functions, how do you do that???

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

    How will I add the "navigation" button? Where it shows more options to different calculator?

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

    Am mad at myself for not having met this channel earlier. 😂 Your content is very educative and I really appreciate your work.

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

    the cod is run successfully but nothing is displaying on my screen for view. pleas help me out thanks.

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

    Can anyone tell what is the font he is writing the code in

  • @Alex-fk2ie
    @Alex-fk2ie 3 года назад

    Thank you for your tutorial ! It helps me a lot

  • @ovi_4
    @ovi_4 2 года назад +4

    Hi, just managed to follow the complete code with NO errors but even then it would just simply not run at all since I just could not install the venc (the virtual environment in python) for some reason. It kept telling me that this computer is missing some permissions for running scripts. So as a result while working on the code I could only rely on no error reporting method (available from within pycharm code window. However, I decided to finalize the code and managed to install pyinstaller in hope that it will run after packing the file into an executable (ready for my win 10 64Bit pro) but to my surprise, the app that I created still doesn't open, and doesn't complain at all. I do not see any error window showing up. I even tried to run the executable file as admin and in compatibility mode but still doesn't work. It is really frustrating after 2 days of working on this code still no joy. Now, what ??? Am I stuck here forever??? Please help anyone outthere. Tnx alot.

    • @jackcorsobarbiere-it7645
      @jackcorsobarbiere-it7645 2 года назад

      me too same problem, did you solved? if yes, how?? @Programiz heeelp

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

      You probably figured it out but I also encountered the same error. Fortunately enough I'm in the era of chatgpt so i was able to find a solution using this command "Set-ExecutionPolicy -Scope CurrentUser RemoteSigned" Paste this command on your terminal when you encounter that problem and it should be fixed. You can then proceed to activate your venv using the activation command. Hopefully this helps

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

    Very cool Soyuz

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

    Can I perform it on Mac 🤔??

  • @sai24243
    @sai24243 3 года назад +4

    iam getting error like( AttributeError: 'Calculator' object has no attribute 'window)

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

    Amazing video! This video deserves 10m like!

  • @lurxy-ur7126
    @lurxy-ur7126 2 года назад

    There should be a backspace button on the calculator, but how will I make that?

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

    Thank you for making this video!!😀

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

    question . when I add too much numbers the whole window stretches. how can I prevent that ?

  • @AmanRaj-rk9or
    @AmanRaj-rk9or 3 месяца назад

    plz tell me that how to write multiply sign in geometry?

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

    why is the window not resizable?

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

    What theme are you using?

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

    calc.run is not showing for me

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

    I can't open the folder using pycharm, no 'open with pycharm" button

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

    Good work, i love this channel.

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

    How about making a sin cos tan button sir, pls help me!

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

    This is a good learning tool. Thx.

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

    Dhanyabad dai❤

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

    How can I make a delete button?

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

    When can i get notes on HTML,CSS,React,DBMS on your website.?

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

    Eagerly Waiting...🔥

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

    thank you ap ne mera school me watt badaha deya

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

    i cant seem to be able to change the background colour can u please help me

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

    On the output screen which is calculator GUI I can't see the operator symbols other than addition. I can see all the numbers, C, = but can't see other operators which are -,%,*. So can you please help me out with it. I used same syntax that you used.

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

    That was a super informative and really nice tutorial to follow along thanks!

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

    After using bind my calculator is not working can please solve the error

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

    Nice tutorial! help me a lot to learn more. Im starting my journey in python and this challenge is very good. But can I ask you a basic thing? Instead of having all the functions in the main .py can we divide them in different scripts and them import to the main or it has to be all in the same? Thanks

    • @Mr-Yuki
      @Mr-Yuki 2 года назад +1

      You can. And then you can import them using the import at the top of your script. Look up how import works and you'll learn how easy it is

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

    when I write the sqrt(10) ,then why it is not showing the floating number??? only sqtr(9) = 3.0 ,sqrt(4) = 2.0 .......are showing the accurate result

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

    Thank you, sir! 😍😍

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

    Throws error in if __name__ function and gui doesn't run

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

    Why was a Lambda function used? When it came to the button(command = lambda:function() ). Why not just the function?

    • @David-fq5un
      @David-fq5un 7 месяцев назад

      You can't directly assign a call to a function with an argument as an assignment, only a function name. lamba lets you get around that.

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

    Thank you for this amazing video man! I do wanna know if you know how to make an erase button, where I can just remove one number at a time?

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

      def click(value):
      ex = entryField.get()
      answer = ''
      try:
      if value == 'C': #Here c = Clear button (works like a backspace key)
      ex = ex[0:len(ex) - 1]
      entryField.delete(0, END)
      entryField.insert(0, ex)
      return
      This will be your command.... now just insert a button using tkinter button command and you are good to go.

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

    Helpful but can't see it well.if you can zoom it a bit for the views

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

    Waiting for it

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

    Thank you so much for this amazing tutorial! I've learned a lot from it. There is only one thing i don't understand and it is why when trying to solve the problem where pressing any key would resulti in only "." being printed on the screen, "lambda x=digit: self.add_to_expression(x)" works, but "lambda: self.add_to_expression(digit)" doesen't. Keep up the amazing work!

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

      I believe that in the first case at the moment of calling the self.add_to_expression(digit) through the lambda function the value of the argument (digit) will corrispond to the last value assigned in the loop (In our case "."). In the second case, with lambda x=digit: self.add_to_expression(x) we assign a default argument to x that corrisponds to the value of digit at the step of the loop where the button is created (The button showing "1" will have a default value of "1", "2" of "2" and so on)

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

    nice video man

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

    how to open folder by pycharm

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

    You can not use pick and grid together

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

    How to enable backspace in the calculator

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

    i try run this code what he try run in 5.40 but when i run it " Error running 'calc': Cannot run program "C:\Users\Käyttäjä\PycharmProjects\animation\venv\Scripts\python.exe" (in directory "C:\Users\Käyttäjä\Desktop\calculator"): CreateProcess error=2, The system cannot find the file specified"
    help

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

    Hello greetings from Venezuela, I am learning python and I decided to do this exercise with you. I'm having trouble using the calculator with the keyboard. I use linux mint, will there be a configuration problem with linux? Thank you for your time. There I send you an extract of the code. Thanks in advance.
    # using calculator from the keyboard
    def bind_keys(self):
    self.window.bind("", lambda event: self.evaluate())
    for key in self.digits:
    self.window.bind(str(key), lambda event, digit = key:
    self.add_to_expression(digit))
    for key in self.operations:
    self.window.bind(key, lambda event, operator = key:
    self.append_operator(operator))

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

      I had also trouble with the keyboard. Please add to the function bind_keys:
      self.window.bind("", lambda event: self.clear()) # add clear key
      self.window.bind("", lambda event: self.square()) # add square key with pressed
      self.window.bind("", lambda event: self sqrt()) # add square-root key with pressed.
      I had no trouble with and keys on my keyboard. If you have, try any other key of yourchoice to perform add_to_expression()

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

    Can you guys make a browser like chrome

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

    Thank you, sir!

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

    _tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack?

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

    How to calculate percentage and create button

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

    very interesting tutorial.straight forward steps but i had an issue when adding Functionality to the Buttons,it doesnt display the value when clicked even i corrected this line of code "command=lambda x=digit: self.add_to_expression(x)"

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

      Lambda is capital, kinda late but hope it helps lol.

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

    thank you!

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

    I am also doing the but it's showing errors because of pack() and grid(), can't use in same class

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

    Please send the coding text..
    Im getting error..while doing eval function

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

    You speak very quitely and the effect sound is too loud. Thanks for the video and online python interpreter!

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

    How can I run on emulator

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

    How to add icon for app

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

    thanks thanks thanks good luck

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

    nice video

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

    Why is it that after I added the Square and sqrt function lines my equals and clear buttons dissapared in the gui? Great video anways.

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

      it coulod happen that you put the sq and sqrt button at the same location of clear and equal

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

    bro video haru nepali ma ni xa?

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

    i'm getting attribure error as 'str' object has no attribute 'tk' @programiz

  • @kushal-shaw-pvt
    @kushal-shaw-pvt Год назад

    Where is the source code for this ??

  • @ДаниилКривко-в9э
    @ДаниилКривко-в9э 3 года назад

    Thanks!

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

    tkinter output is not opening,I don't know why? Any one know solution

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

    great great video

  • @VC-pd6vy
    @VC-pd6vy Год назад

    AttributeError: 'Calculator' object has no attribute 'window' can anyone help me?

    • @David-fq5un
      @David-fq5un 7 месяцев назад

      try starting again from scratch. or try copying just the basic start code from his code at GitHub. I had that problem at first, and couldn't figure out why it didn't work for me.

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

    This video leaves me with mixed feelings. It shows important solutions that everyone will come across when working with tkinter.
    But one thing bothers me a lot. In this video there is little explanation of why such decisions were made and what the long-term benefits are.
    For example, I wondered why we don't fill the dictionary with all the buttons. Later in the video this becomes clear, but the viewer must ultimately make the findings himself.
    Likewise, the concept of updating the label didn't really make sense to me until later and you just had to accept it during the implementation.
    In the end, the video probably shows interesting concepts, but doesn't really go into why things are solved this way, but simply does it.

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

      It's impossible to debug because none of it explained well at all. I've tried comparing code exactly and I can't explain why I'm having this problem (the numbers appearing at the top but not the bottom display label). But his "I'm just going to---" comments make no sense.

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

      @@Jdeadevil can you show your code? Maybe I can help.

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

    hi could you please share the entire code in a file. thanks

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

    สวัสดีคับทุกคนๆ ทำไรกันอยู่เหรอ
    งื้องื้อ หยอกเล่นนะคับ อิอิ โทดคับ

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

    NICE

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

    nepal bata ho??

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

    When you 04 ÷ 3 it give you error pls help

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

      because of the zero : if you do 4 / 3 = correct result displayed!

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

    Me to waiting

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

    Nice. Could you make a project with pyqt5?

  • @tomoyaokazaki9915
    @tomoyaokazaki9915 3 года назад +13

    Also one thing convert that python file into .exe file and share it with us .

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

      That’s not how that works

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

      @@leomonk974 This kid thinks everything is so simple😂 i guess he doesn't even know how many characters do we write to get a single world hello🙃

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

      @@adityaraj04 just 4 lines of code to make a simple label texted hello world

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

      @@alaa6809 c language 🙂

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

      @@leomonk974 lol that is how it works.

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

    I have a problem for some time, when I try to open a .exe file that has been created from a python file it opens a console and then it instantly coses it. I'm not sure what should I do to fix this. Any help is appreciated

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

      Hi Tomas, please make sure that .exe file is created successfully with the required command line parameters.

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

      While making .exe file you have to mention --noconsole and make sure to add mainlooop at end of program.

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

    Anyone can provide me source code?

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

    - day 1 ___ 17:25 .

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

    please upload dart programming video

  • @memehub.112
    @memehub.112 2 года назад

    im getting alot of errors