Simple GUI Calculator in Python

  Рет қаралды 235,100

NeuralNine

NeuralNine

2 жыл бұрын

Today we build a simple GUI calculator in Python. For the graphical user interface we use tkinter.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер: 181
@BrendanBurkartSF
@BrendanBurkartSF 9 ай бұрын
this was super helpful and really well done! I actually really liked that you had the lambda still in there for the btn_equals...it let us see your debugging process. Thank you!
@wko_
@wko_ 2 жыл бұрын
Very simple and very useful! Thanks for one more project like this!
@nipoteemus2472
@nipoteemus2472 2 жыл бұрын
Thanks for the tutorial! I have that kind of school project where I have to make a representation of your favorite hobby or that stuff! I planned to make it about coding and I'm trying to do 3 softwares for it and this is fricking good idea!
@thatgarryman9400
@thatgarryman9400 4 ай бұрын
Literally explained better than half of the programmers in KZbin. Makes sense, explains, doesn't do unnecessary stuff.
@efogovirtual9635
@efogovirtual9635 9 ай бұрын
I appreciate you, this is absolutely useful, nice tutorial
@arslanuzakov988
@arslanuzakov988 Жыл бұрын
i really like that thats the first youtube project thats works without error, thank you sir
@AbubakarMulla23
@AbubakarMulla23 2 жыл бұрын
Love your coding bro... Stay going on..
@scratchersdotcom9336
@scratchersdotcom9336 Жыл бұрын
Very nice tutorial. I very well understood. Really appreciate it 👏
@user-mz9ql7oc9j
@user-mz9ql7oc9j Жыл бұрын
Very simple and very useful! Thanks ❤ 🇲🇦
@deeparose2926
@deeparose2926 2 жыл бұрын
Loved it!!
@tomasg101
@tomasg101 Жыл бұрын
Thank you dude, I´m learning Python and this was perfect to achieve new knowledge Greetins from Argentina
@cannafarmer
@cannafarmer 2 жыл бұрын
Thank you for the videos I like to scan them quick when i'm stuck
@haokaixuan
@haokaixuan 2 жыл бұрын
love these projects!
@bonyimakaveli633
@bonyimakaveli633 Жыл бұрын
Big thanks man. Really appreciate what you do.
@DC_Luxurious_Cars_
@DC_Luxurious_Cars_ 10 ай бұрын
I really enjoyed this. Thank you very much.
@100mikedaniel6
@100mikedaniel6 2 жыл бұрын
Stay on the upload grind!
@NeuralNine
@NeuralNine 2 жыл бұрын
one video every other day! 💪🏻
@AlexMuseMatrix
@AlexMuseMatrix 2 ай бұрын
Try 4 videos Every day, It's a great schedule 😎@@NeuralNine
@yadobeatz359
@yadobeatz359 11 ай бұрын
very simle and helpful a lot, thank you a lot
@anonymspro7864
@anonymspro7864 2 жыл бұрын
Great bro i was finding this only from a long time.Thanks for uploading in this Content.I'm excited for your next video please upload it as soon as possible :) :) :) :) ;) ;)
@tsmghost
@tsmghost 2 жыл бұрын
Already made that but still learnt something new❤️❤️❤️
@theminecrafttree8913
@theminecrafttree8913 2 жыл бұрын
nice flex
@arnavmeena525
@arnavmeena525 2 жыл бұрын
NeuralNine: *Making Calculator and is doing calculations on it* Also NeuralNine: Am gonna do the calculations myself. Who needs a calculator?
@exxavier1695
@exxavier1695 7 ай бұрын
I love the project it was very useful and helpful thanks
@rodinicen689
@rodinicen689 2 ай бұрын
Very nice video! More of this! :D
@user-wv1kr2pz1q
@user-wv1kr2pz1q Жыл бұрын
Interesting explanation ❤
@himanshuranjansingh6134
@himanshuranjansingh6134 2 жыл бұрын
Thank you man🌻
@sarveshsargunan4914
@sarveshsargunan4914 Жыл бұрын
i learned a lot from this video and i did it myself as well
@fayazshams-rd3ek
@fayazshams-rd3ek Жыл бұрын
Really really really Great i wish you more success ❤❤❤
@tortu_nashe
@tortu_nashe 9 ай бұрын
nice vid liked n subed , made me feelike programming more
@kennethlourisombrog2149
@kennethlourisombrog2149 4 ай бұрын
Nice. Do you think I can include this in my portfolio to apply for a job? I can say that I followed your tutorial and learned from it.
@dieelitezwerge7622
@dieelitezwerge7622 Жыл бұрын
thanks for another very nice video😇😉
@lerserk
@lerserk 11 ай бұрын
19:46 Its the lambda bro!! Thank you for this!
@sithhill
@sithhill Жыл бұрын
How does this do the actual math portion without telling it to do a math calculation? The other calculator I made doesn't have a GUI but all the code is to specify the actual math method being used versus, all we (you) did was create buttons. I followed along and just don't understand how it's automatically doing the math.
@theminecrafttree8913
@theminecrafttree8913 2 жыл бұрын
the best tutorial ever bro u da best
@maitruong7909
@maitruong7909 5 ай бұрын
Awesome! 10 points
@EBKCS_DHRUV_SHARMA
@EBKCS_DHRUV_SHARMA 10 ай бұрын
man i love you, best is what i think you are!!!!
@rezalapriani1001
@rezalapriani1001 2 жыл бұрын
i learn from your video, thanks you soo much
@patibandlalatha7530
@patibandlalatha7530 5 ай бұрын
Very much helpful to the python learners
@brendanjordan5485
@brendanjordan5485 Жыл бұрын
Thank you for the video! If I want to make it so that I don't have to type a '*' before the parenthesis for the code to recognize that it should multiply, how do I make it so that this code recognizes that 'x(a)", where x and a are any number , are suppose to multiply? Like if I want it to calculate "90/3(1+2)"
@jeez8136
@jeez8136 Жыл бұрын
i was wondering that too so i asked chatgpt and this is what it said: To make the code recognize this implicit multiplication, you can add a check in the add_to_calculation function to see if the last symbol in the calculation string is a number, and if so, add the multiplication symbol before adding the parentheses. Here is an updated add_to_calculation function that implements this logic: def add_to_calculation(symbol): global calculation if symbol == "(" and calculation != "" and calculation[-1].isdigit(): calculation += "*" calculation += str(symbol) text_result.delete(1.0, "end") text_result.insert(1.0, calculation) With this code, if the user types a number followed by an opening parenthesis, the function will automatically insert a multiplication symbol before the parenthesis. This means that if the user types "90/3(1+2)", the calculation string will become "90/3*(1+2)" before evaluation.
@TheRealStrider
@TheRealStrider 9 ай бұрын
@@jeez8136 So I was wondering this as well and have finally made it work behind the scenes without it showing it add the * before the (. Here is the code: implicit = list(calculation) i = 0 while i
@oadeep
@oadeep 8 ай бұрын
thank you so much it works@@TheRealStrider
@rushikeshmali3057
@rushikeshmali3057 29 күн бұрын
Thanks for beautiful guidens
@surfineer
@surfineer Жыл бұрын
Interesting explanation on the eval() functionality. But what alternatives would you suggest for better security?
@GeovaniLopesDias
@GeovaniLopesDias Жыл бұрын
I didn't watched it with audio on, so I don't know what security issues he mentioned, but I was wondering the whole video when would he write the regex code to interpret the string arithmetic expression. It'd require some extra functions to substitute the eval() built-in. For personal challenge, we could try to code these said extra functions.
@skystep2
@skystep2 11 ай бұрын
I am noob, but I would not allowed letters, only go execute eval if there are no letters and other not allowed symbols
@v11r
@v11r 8 ай бұрын
You need to implement a tree
@akellner2
@akellner2 6 ай бұрын
Thank you for sharing, I wonder how I can implement an %-Button with the correct function. I tried it but I can`t figure it out.
@zhangchill1616
@zhangchill1616 7 ай бұрын
Very simple Thank yous
@RahulKumar-cm1sy
@RahulKumar-cm1sy 21 күн бұрын
Thank you sir ❤
@feliperodrigues3277
@feliperodrigues3277 Жыл бұрын
You're the best one to explain, ty so much man
@wise_beanss
@wise_beanss 11 ай бұрын
is it possible to make a delete button? If so how do you do it, cos i have been trying to figure it out for the past week, but still can’t (i’m a beginner btw)
@alirezaahmadivand831
@alirezaahmadivand831 2 жыл бұрын
Thanks a lot 🙏
@piklif5278
@piklif5278 Жыл бұрын
this helped me so mauch thax
@aradthetyper2101
@aradthetyper2101 Жыл бұрын
brilliant! just one thing. i don't get the part where you put (1.0, "end") after text_result.delete or text_result.insert. what do they mean?
@poorvinalavade8651
@poorvinalavade8651 Жыл бұрын
even i want to know the meaning of those parameters
@timmyt1232
@timmyt1232 Жыл бұрын
In tkinter (for text), delete(first index position, last index position). The 1 is first line. The 0 is before first character. The "end" is to the end of the text. insert(index position, string)
@Himlajchan
@Himlajchan 6 күн бұрын
@@timmyt1232 Would you mind explaining where this 'end' argument is defined? Tried to look into the source via PyCharm, but couldn't find where this is specified, not even in any documentation that I looked trough. How can I know what other strings are valid for the index parameter?
@housemajaliwa
@housemajaliwa 11 ай бұрын
Good stuff
@Victory-py7lp
@Victory-py7lp 2 ай бұрын
Can someone explain why he uses the .delete first before the .insert? What does that do?
@PCANDPOCO
@PCANDPOCO 19 күн бұрын
thank you very much
@fzel1
@fzel1 4 ай бұрын
the amount of time he takes to build the calculator is so impressive
@davidianmusic4869
@davidianmusic4869 8 ай бұрын
Thanks!
@flowereye3720
@flowereye3720 2 жыл бұрын
Thank you
@Tom-ks9xl
@Tom-ks9xl 4 ай бұрын
Fantastic
@paulmwangi270
@paulmwangi270 11 ай бұрын
The tutorial was topnotch
@yoonesaghtaii8991
@yoonesaghtaii8991 3 ай бұрын
thanks bro❤
@sepgorut2492
@sepgorut2492 2 жыл бұрын
Computerphile has an interesting approach to evaluating equations using functional programming: kzbin.info/www/bejne/baWmf6hqeNOdjMU
@akshar088
@akshar088 3 ай бұрын
amazing
@Void-Dev
@Void-Dev Жыл бұрын
For the buttons why not just use a definition?
@evoamer2686
@evoamer2686 4 ай бұрын
You have made me switch from C# to python my friend
@noir66146
@noir66146 2 жыл бұрын
my kind of tutorial
@ethan_haymore3907
@ethan_haymore3907 2 ай бұрын
everything worked but the buttons only work individually instead of 1+2 it would just say the number by itself when clicked instead of holding memory. any tips or advice
@brany2920
@brany2920 Жыл бұрын
i have tried installing this Tkinter but still wouldnt work on my window 10 or my mac pro. its so confusing i get this error : "ModuleNotFoundError: No module named '_tkinter'" what do i do
@anirudhpm7155
@anirudhpm7155 Жыл бұрын
How can i add √ and on off button could you please help me.
@svetlanadelrey973
@svetlanadelrey973 6 ай бұрын
i would love if u explained what are you doing in ur actions
@sianbunny7724
@sianbunny7724 2 ай бұрын
thnx man 🙏
@anakin.gulliver
@anakin.gulliver 2 жыл бұрын
can you help me? I get the error: ModuleNotFoundError: No module named 'tkinter' when i tri to do the first test run. I cant seem to get it to work on any ide expect on python terminal alone.
@LyricZ
@LyricZ 2 жыл бұрын
import tkinter
@KatherineHunt-bz9fg
@KatherineHunt-bz9fg 5 ай бұрын
Learning python on a calculator
@abhinavgangwar4690
@abhinavgangwar4690 8 күн бұрын
Thats a classic chad move
@support_gaza
@support_gaza 11 ай бұрын
You needed 2 minutes to figure out the problem but you still didn't figure it but got another solution but my solution was after 2 secs after I saw the code and it is to put brackets after evaluate_calculation and it worked with me 😅
@tummatantewadonprasit639
@tummatantewadonprasit639 2 ай бұрын
Tysm❤❤😊
@user-qt4jh1lq6s
@user-qt4jh1lq6s 2 ай бұрын
Thanks
@iumamaiftikhar
@iumamaiftikhar Жыл бұрын
sir i have a problem on line 5 iwrote it correct what should i do
@caw986
@caw986 Жыл бұрын
hi good video all in all but the code keeps on throwing the error message at me when i perform any calculations
@cheesefries6616
@cheesefries6616 Жыл бұрын
could anyone explain more about the text_result.delete(1.0, "error") and text_result.insert(1.0, calculation). I'm confused as hell
@mariustrelea5132
@mariustrelea5132 2 жыл бұрын
Can you implement it with constants e and π , and also trigonometric functions
@flowman8414
@flowman8414 2 жыл бұрын
well do try to do it yourself
@mariustrelea5132
@mariustrelea5132 2 жыл бұрын
@@flowman8414 import math has trigonometric functions and also the inverse functions of themselves ?
@flowman8414
@flowman8414 2 жыл бұрын
@@mariustrelea5132 yea i think so
@Tom-ks9xl
@Tom-ks9xl 4 ай бұрын
What interface are you using? Looks very good. The standard IDE isn't as nice as this
@N7ShepardSR
@N7ShepardSR 3 ай бұрын
PyCharm its really good
@Tom-ks9xl
@Tom-ks9xl 3 ай бұрын
Thank you i found it and installed it right onto linux. It's a very nice interface and handy.
@jokemiri
@jokemiri Жыл бұрын
I just completed this. Is it possible to clear the screen after a result when a new number is keyed? Thank you for the tutorial.
@youngistaan5883
@youngistaan5883 7 ай бұрын
And also there should ve back space
@therumblemain
@therumblemain 8 ай бұрын
so usefull and hepfull I subsribed this is my 2nd videio watching
@affenkratzer
@affenkratzer 2 ай бұрын
i have also a function if you want to remove one character from the calculation if you made an error typing, but you need an extra delete button for it: def remove(): global calculation if calculation: calculation = calculation[:-1] text_result.delete(1.0, "end") text_result.insert(1.0, calculation) pass pass
@Victory-py7lp
@Victory-py7lp 2 ай бұрын
Thank you so much.
@Soo-qd1co
@Soo-qd1co 2 ай бұрын
thank buddy 🙏
@Victory-py7lp
@Victory-py7lp 2 ай бұрын
Can you please explain why he .delete came before the .insert?
@affenkratzer
@affenkratzer 2 ай бұрын
@@Victory-py7lp because of the grid placement you need to change it
@HardeepSingh-ec4zq
@HardeepSingh-ec4zq 2 ай бұрын
How can I add percentage button in this program
@nellcid7909
@nellcid7909 Жыл бұрын
how to fix "text_result" is not defined error?
@ernurernur303
@ernurernur303 Жыл бұрын
hey guys , how to add backspace function ? if you know pliss
@harshalpatil2618
@harshalpatil2618 8 ай бұрын
Super vdo
@Cheezou.
@Cheezou. 2 жыл бұрын
Where is the code , i wanna compare with mine pls
@soufatldude700
@soufatldude700 Ай бұрын
do you need pycharm for this, or can you use the normal python application?
@reaction_124
@reaction_124 4 күн бұрын
hi gojo kun
@soufatldude700
@soufatldude700 4 күн бұрын
@@reaction_124 Nah i'd win.
@Knowmemelife
@Knowmemelife 7 ай бұрын
Brow what will I do if on calculator I click 1 and the result is always calculation
@swarnarekha578
@swarnarekha578 2 жыл бұрын
0:42 when he said nonsense haha
@dedehurairrah4345
@dedehurairrah4345 12 күн бұрын
When i click the number are error, can you repair my code?
@speedev
@speedev 2 жыл бұрын
Thx.
@NeuralNine
@NeuralNine 2 жыл бұрын
^^
@googlegoogle1610
@googlegoogle1610 2 жыл бұрын
i like your video but why not to paste the code in the description
@leadgebrat9880
@leadgebrat9880 Жыл бұрын
The delete function is not working... Gives an Attribute error
@user-pm5bx5tg4g
@user-pm5bx5tg4g 3 ай бұрын
After lambda add to command is not showing in blue colour
@SnowNight
@SnowNight Жыл бұрын
intro music name?
@joemjencombs8202
@joemjencombs8202 Жыл бұрын
there is still somehow a small problem with my code, as except additions, nothing else works and it just does (e.g.) 3x3=Error
@onemangamer587
@onemangamer587 Жыл бұрын
Are you using "*" or "x"? Because "x" will throw an error
@unknown-cz5yh
@unknown-cz5yh Жыл бұрын
error is occuring when i am adding 1+1 how to solve this problem
@Al_X-2005
@Al_X-2005 3 ай бұрын
Now that I can make custom buttons I can finally create the Calculator 2
@newlookak47
@newlookak47 2 ай бұрын
Where can I get your code?
@frigontech
@frigontech Жыл бұрын
20:24, do equals without the lambda
@support_gaza
@support_gaza 11 ай бұрын
How to delete one number?
@kingkoller1503
@kingkoller1503 4 ай бұрын
Great tutorial! But in my case (I don't know why) I have to use lambda for all functions so that it would work. And also the result of the previous calculation isn't transferred to the new one. Does anybody know what's wrong?
@shouryathakur9643
@shouryathakur9643 4 ай бұрын
idk
@fzel1
@fzel1 4 ай бұрын
show ur code
5 Mini Python Projects - For Beginners
1:41:08
Tech With Tim
Рет қаралды 2,7 МЛН
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 52 МЛН
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 36 МЛН
КАХА и Джин 2
00:36
К-Media
Рет қаралды 2,3 МЛН
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 332 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,4 МЛН
Python calculator app 🖩
15:08
Bro Code
Рет қаралды 65 М.
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 465 М.
👩‍💻 Python for Beginners Tutorial
1:03:21
Kevin Stratvert
Рет қаралды 3 МЛН
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1 МЛН
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,5 МЛН
ASMR Programming - Calculator App Coding - No Talking
34:06
AsmrProg
Рет қаралды 4,4 МЛН
10 Python Comprehensions You SHOULD Be Using
21:35
Tech With Tim
Рет қаралды 97 М.
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 14 МЛН
Samsung Android Mobile Battrey
0:39
Gaming zone
Рет қаралды 342 М.