Simple GUI Calculator in Python

  Рет қаралды 292,504

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 208
@thatgarryman9400
@thatgarryman9400 Жыл бұрын
Literally explained better than half of the programmers in KZbin. Makes sense, explains, doesn't do unnecessary stuff.
@arnavmeena525
@arnavmeena525 3 жыл бұрын
NeuralNine: *Making Calculator and is doing calculations on it* Also NeuralNine: Am gonna do the calculations myself. Who needs a calculator?
@BrendanBurkartSF
@BrendanBurkartSF Жыл бұрын
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!
@marcosvalencia1883
@marcosvalencia1883 3 ай бұрын
Yes
@lerserk
@lerserk Жыл бұрын
19:46 Its the lambda bro!! Thank you for this!
@arslanuzakov988
@arslanuzakov988 2 жыл бұрын
i really like that thats the first youtube project thats works without error, thank you sir
@Lejo1_LV
@Lejo1_LV 6 ай бұрын
now i can not agree it dosent wor to me
@soufatldude700
@soufatldude700 9 ай бұрын
do you need pycharm for this, or can you use the normal python application?
@reaction_124
@reaction_124 7 ай бұрын
hi gojo kun
@soufatldude700
@soufatldude700 7 ай бұрын
@@reaction_124 Nah i'd win.
@Veestar4u
@Veestar4u 10 ай бұрын
Can someone explain why he uses the .delete first before the .insert? What does that do?
@100mikedaniel6
@100mikedaniel6 3 жыл бұрын
Stay on the upload grind!
@NeuralNine
@NeuralNine 3 жыл бұрын
one video every other day! 💪🏻
@AlexMuseMatrix
@AlexMuseMatrix 9 ай бұрын
Try 4 videos Every day, It's a great schedule 😎@@NeuralNine
@xxpotatoxx1080p
@xxpotatoxx1080p 16 күн бұрын
so good will use my own calculator from now on
@wko_
@wko_ 3 жыл бұрын
Very simple and very useful! Thanks for one more project like 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.
@johnbishoppp
@johnbishoppp 2 ай бұрын
I think it's the eval() function that's doing the math. At 5:30 he mentions that the eval function will evaluate both mathematical equations as well as code.
@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!
@Tdahandaluz.
@Tdahandaluz. 3 ай бұрын
I've always wanted to learn to program and this video helped me understand that my biggest enemy is going to be my dyslexia xD
@kalacarte
@kalacarte Жыл бұрын
for some reason line 19 isnt working ofr me at 3:43 through 3 :53
@aradthetyper2101
@aradthetyper2101 2 жыл бұрын
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 2 жыл бұрын
even i want to know the meaning of those parameters
@timmyt1232
@timmyt1232 2 жыл бұрын
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 7 ай бұрын
@@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?
@anirudhpm7155
@anirudhpm7155 Жыл бұрын
How can i add √ and on off button could you please help me.
@AbubakarMulla23
@AbubakarMulla23 3 жыл бұрын
Love your coding bro... Stay going on..
@hemanmoriya8237
@hemanmoriya8237 10 ай бұрын
I made the project the completely but I didn't learned many things from it because it was copy paste time type program for me .
@Soo-qd1co
@Soo-qd1co 10 ай бұрын
which code editor did you use? I used codesandbox and don't show the pop up page for blank page for... import tkinter as tk calculation = "" def add_to_calculation(symbol): pass def evaluate_calculation(): pass def clear_field(): pass root = tk.Tk() root.geometry("300x275") root.mainloop() and shows up Traceback (most recent call last): File "calculator.py", line 18, in root = tk.Tk() File "/usr/local/lib/python3.8/tkinter/__init__.py", line 2270, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable
@hemanmoriya8237
@hemanmoriya8237 10 ай бұрын
@@Soo-qd1co I used pycharm for python development
@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 Жыл бұрын
@@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 Жыл бұрын
thank you so much it works@@TheRealStrider
@efogovirtual9635
@efogovirtual9635 Жыл бұрын
I appreciate you, this is absolutely useful, nice tutorial
@Void-Dev
@Void-Dev 2 жыл бұрын
For the buttons why not just use a definition?
@LikinMB
@LikinMB 17 күн бұрын
Great explanation sir, but it would be better if there was "Clear entry" button which only clears the last number that is entered and I how can I implement that ?
@haokaixuan
@haokaixuan 3 жыл бұрын
love these projects!
@fzel1
@fzel1 11 ай бұрын
the amount of time he takes to build the calculator is so impressive
@scratchersdotcom9336
@scratchersdotcom9336 2 жыл бұрын
Very nice tutorial. I very well understood. Really appreciate it 👏
@wise_beanss
@wise_beanss Жыл бұрын
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)
@ethan_haymore3907
@ethan_haymore3907 9 ай бұрын
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
@anakin.gulliver
@anakin.gulliver 3 жыл бұрын
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
@tsmghost
@tsmghost 3 жыл бұрын
Already made that but still learnt something new❤️❤️❤️
@theminecrafttree8913
@theminecrafttree8913 2 жыл бұрын
nice flex
@BruceChangwe-yt9ce
@BruceChangwe-yt9ce 4 күн бұрын
plaese help I followed everything but when I press a number it's giving me a word calculation. what could be the error
@deeparose2926
@deeparose2926 3 жыл бұрын
Loved it!!
@akellner2
@akellner2 Жыл бұрын
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.
@kennethlourisombrog2149
@kennethlourisombrog2149 Жыл бұрын
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.
@AbhayGupta-oz1ix
@AbhayGupta-oz1ix 5 ай бұрын
This is what i was looking for. Thanks to tutor.
@affenkratzer
@affenkratzer 10 ай бұрын
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
@Veestar4u
@Veestar4u 10 ай бұрын
Thank you so much.
@Soo-qd1co
@Soo-qd1co 10 ай бұрын
thank buddy 🙏
@Veestar4u
@Veestar4u 10 ай бұрын
Can you please explain why he .delete came before the .insert?
@affenkratzer
@affenkratzer 10 ай бұрын
@@Veestar4u because of the grid placement you need to change it
@caw986
@caw986 2 жыл бұрын
hi good video all in all but the code keeps on throwing the error message at me when i perform any calculations
@shaunakwasker20
@shaunakwasker20 3 ай бұрын
super helpful and clear, thanks a lot
@riascho
@riascho Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
You need to implement a tree
@tomasg101
@tomasg101 Жыл бұрын
Thank you dude, I´m learning Python and this was perfect to achieve new knowledge Greetins from Argentina
@bonyimakaveli633
@bonyimakaveli633 2 жыл бұрын
Big thanks man. Really appreciate what you do.
@القراءةمفتاحالعلم
@القراءةمفتاحالعلم Жыл бұрын
Very simple and very useful! Thanks ❤ 🇲🇦
@pan_ching
@pan_ching 7 ай бұрын
How do you do the copy paste trick??? damn. It seems like it's a shortcut key or somethin' it was so quick ahahahhah
@yadobeatz359
@yadobeatz359 Жыл бұрын
very simle and helpful a lot, thank you a lot
@anonymspro7864
@anonymspro7864 3 жыл бұрын
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 :) :) :) :) ;) ;)
@MAhmed12_5
@MAhmed12_5 5 ай бұрын
bro thank you very much. you made my day. keep up
@Knowmemelife
@Knowmemelife Жыл бұрын
Brow what will I do if on calculator I click 1 and the result is always calculation
@srshivam96
@srshivam96 2 ай бұрын
Not working now it says TypeError: 'float' object is not subscriptable whenever i press a button
@DC_Luxurious_Cars_
@DC_Luxurious_Cars_ Жыл бұрын
I really enjoyed this. Thank you very much.
@Tom-ks9xl
@Tom-ks9xl 11 ай бұрын
What interface are you using? Looks very good. The standard IDE isn't as nice as this
@N7ShepardSR
@N7ShepardSR 11 ай бұрын
PyCharm its really good
@Tom-ks9xl
@Tom-ks9xl 11 ай бұрын
Thank you i found it and installed it right onto linux. It's a very nice interface and handy.
@johnbishoppp
@johnbishoppp 2 ай бұрын
Why not make a class with attributes for the number, row and column, then make a function for creating the button and run it in a for loop. This is how I did it, to save time and not repeat code. I couldn't figure out how to make the loop also name the buttons incrementally (i.e. btn_1, then btn_2) so I had to type that manually. Also had to manually type out the code for equals and clear as the command was different to the others. Would love your thoughts.
@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
@diegos2184
@diegos2184 4 ай бұрын
where did u learn to code?
@svetlanadelrey973
@svetlanadelrey973 Жыл бұрын
i would love if u explained what are you doing in ur actions
@fayazshams-rd3ek
@fayazshams-rd3ek Жыл бұрын
Really really really Great i wish you more success ❤❤❤
@HardeepSingh-ec4zq
@HardeepSingh-ec4zq 9 ай бұрын
How can I add percentage button in this program
@server123
@server123 2 жыл бұрын
intro music name?
@frigontech
@frigontech Жыл бұрын
20:24, do equals without the lambda
@finpas9915
@finpas9915 4 күн бұрын
Great Video. Thank you very much!🙏🙏🙏
@ChudiO
@ChudiO 4 ай бұрын
Really good tutorial, has helped improve my Python knowledge 😊
@SahilPatel-f4u
@SahilPatel-f4u 10 ай бұрын
After lambda add to command is not showing in blue colour
@cannafarmer
@cannafarmer 3 жыл бұрын
Thank you for the videos I like to scan them quick when i'm stuck
@EBKCS_DHRUV_SHARMA
@EBKCS_DHRUV_SHARMA Жыл бұрын
man i love you, best is what i think you are!!!!
@iumamaiftikhar
@iumamaiftikhar Жыл бұрын
sir i have a problem on line 5 iwrote it correct what should i do
@rodinicen689
@rodinicen689 10 ай бұрын
Very nice video! More of this! :D
@patibandlalatha7530
@patibandlalatha7530 Жыл бұрын
Very much helpful to the python learners
@dieelitezwerge7622
@dieelitezwerge7622 2 жыл бұрын
thanks for another very nice video😇😉
@KatherineHunt-bz9fg
@KatherineHunt-bz9fg Жыл бұрын
Learning python on a calculator
@abhinavgangwar4690
@abhinavgangwar4690 7 ай бұрын
Thats a classic chad move
@evoamer2686
@evoamer2686 11 ай бұрын
You have made me switch from C# to python my friend
@leadgebrat9880
@leadgebrat9880 2 жыл бұрын
The delete function is not working... Gives an Attribute error
@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 Жыл бұрын
And also there should ve back space
@jasongonzalez502
@jasongonzalez502 6 ай бұрын
Can anyone explain to me how he navigates the code by highlighting a single character then just skimming it? I'm a bit new to coding and am still learning much. - Thanks!
@tortu_nashe
@tortu_nashe Жыл бұрын
nice vid liked n subed , made me feelike programming more
@YukiArtsandCrafts
@YukiArtsandCrafts Жыл бұрын
Interesting explanation ❤
@theminecrafttree8913
@theminecrafttree8913 2 жыл бұрын
the best tutorial ever bro u da best
@VrUnknown
@VrUnknown 7 ай бұрын
when you put root = tk.Tk() it worked perfectly for you but for me it's says AttributeError: module 'tkinter' has no attribute 'tk'
@zainnusairat7745
@zainnusairat7745 6 ай бұрын
did u import tkinter as tk? otherwise u would have to write tkinter.Tk(), u should import it as tk not to waste time
@exxavier1695
@exxavier1695 Жыл бұрын
I love the project it was very useful and helpful thanks
@support_gaza
@support_gaza Жыл бұрын
How to delete one number?
@sarveshsargunan4914
@sarveshsargunan4914 Жыл бұрын
i learned a lot from this video and i did it myself as well
@joemjencombs8202
@joemjencombs8202 2 жыл бұрын
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
@skitmc5842
@skitmc5842 10 ай бұрын
17:17 (just a marker so i can skip back into the video without losing where i was before)
@nellcid7909
@nellcid7909 2 жыл бұрын
how to fix "text_result" is not defined error?
@googlegoogle1610
@googlegoogle1610 3 жыл бұрын
i like your video but why not to paste the code in the description
@Cheezou.
@Cheezou. 3 жыл бұрын
Where is the code , i wanna compare with mine pls
@ernurernur303
@ernurernur303 2 жыл бұрын
hey guys , how to add backspace function ? if you know pliss
@dedehurairrah4345
@dedehurairrah4345 7 ай бұрын
When i click the number are error, can you repair my code?
@mariustrelea5132
@mariustrelea5132 3 жыл бұрын
Can you implement it with constants e and π , and also trigonometric functions
@flowman8414
@flowman8414 3 жыл бұрын
well do try to do it yourself
@mariustrelea5132
@mariustrelea5132 3 жыл бұрын
@@flowman8414 import math has trigonometric functions and also the inverse functions of themselves ?
@flowman8414
@flowman8414 3 жыл бұрын
@@mariustrelea5132 yea i think so
@unknown-cz5yh
@unknown-cz5yh Жыл бұрын
error is occuring when i am adding 1+1 how to solve this problem
@cheesefries6616
@cheesefries6616 2 жыл бұрын
could anyone explain more about the text_result.delete(1.0, "error") and text_result.insert(1.0, calculation). I'm confused as hell
@rekhNZ
@rekhNZ 3 жыл бұрын
0:42 when he said nonsense haha
@ኢትዮጵኑብያ
@ኢትዮጵኑብያ Жыл бұрын
It says text result not defiend
@maitruong7909
@maitruong7909 Жыл бұрын
Awesome! 10 points
@Al_X-2005
@Al_X-2005 10 ай бұрын
Now that I can make custom buttons I can finally create the Calculator 2
@feliperodrigues3277
@feliperodrigues3277 2 жыл бұрын
You're the best one to explain, ty so much man
@himanshuranjansingh6134
@himanshuranjansingh6134 3 жыл бұрын
Thank you man🌻
@bjornofficial5921
@bjornofficial5921 2 жыл бұрын
Everything works except when I press = I get a white screen (It doesn't calculate)
@wise_beanss
@wise_beanss Жыл бұрын
instead of removing the lambda, try putting evaluate_calculation() it works for me as far as i know
@zhangchill1616
@zhangchill1616 Жыл бұрын
Very simple Thank yous
@Hunter-kd4gi
@Hunter-kd4gi 11 ай бұрын
SyntaxError: expected 'except' or 'finally' block
@kingkoller1503
@kingkoller1503 11 ай бұрын
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?
@yoriichi_245
@yoriichi_245 11 ай бұрын
idk
@fzel1
@fzel1 11 ай бұрын
show ur code
@br_thinkpad_py
@br_thinkpad_py Жыл бұрын
what program that using for python?
@jonconstatine1408
@jonconstatine1408 7 ай бұрын
it's an inbuilt python module Called tkinter
@justdaviddd
@justdaviddd 10 ай бұрын
It doesn't open anything, but it also shows that it has zero problems. How to open it
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 716 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,7 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
Android App Development in Python With Kivy
26:27
NeuralNine
Рет қаралды 296 М.
Python calculator app 🖩
15:08
Bro Code
Рет қаралды 83 М.
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 558 М.
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 1 МЛН
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 412 М.
How to Build a Simple Calculator in Python - Step by Step 1
15:37
Kindson The Tech Pro
Рет қаралды 392 М.
Tkinter Beginner Course - Python GUI Development
38:59
NeuralNine
Рет қаралды 582 М.
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
11:16
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН