Тёмный

Simple GUI Calculator in Python 

NeuralNine
Подписаться 348 тыс.
Просмотров 245 тыс.
50% 1

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/

Наука

Опубликовано:

 

24 июл 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 186   
@BrendanBurkartSF
@BrendanBurkartSF 10 месяцев назад
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!
@thatgarryman9400
@thatgarryman9400 5 месяцев назад
Literally explained better than half of the programmers in RU-vid. Makes sense, explains, doesn't do unnecessary stuff.
@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!
@efogovirtual9635
@efogovirtual9635 10 месяцев назад
I appreciate you, this is absolutely useful, nice tutorial
@deeparose2926
@deeparose2926 2 года назад
Loved it!!
@user-mz9ql7oc9j
@user-mz9ql7oc9j Год назад
Very simple and very useful! Thanks ❤ 🇲🇦
@AbubakarMulla23
@AbubakarMulla23 2 года назад
Love your coding bro... Stay going on..
@DC_Luxurious_Cars_
@DC_Luxurious_Cars_ 11 месяцев назад
I really enjoyed this. Thank you very much.
@bonyimakaveli633
@bonyimakaveli633 Год назад
Big thanks man. Really appreciate what you do.
@cannafarmer
@cannafarmer 2 года назад
Thank you for the videos I like to scan them quick when i'm stuck
@arnavmeena525
@arnavmeena525 2 года назад
NeuralNine: *Making Calculator and is doing calculations on it* Also NeuralNine: Am gonna do the calculations myself. Who needs a calculator?
@scratchersdotcom9336
@scratchersdotcom9336 Год назад
Very nice tutorial. I very well understood. Really appreciate it 👏
@tomasg101
@tomasg101 Год назад
Thank you dude, I´m learning Python and this was perfect to achieve new knowledge Greetins from Argentina
@yadobeatz359
@yadobeatz359 Год назад
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 :) :) :) :) ;) ;)
@haokaixuan
@haokaixuan 2 года назад
love these projects!
@arslanuzakov988
@arslanuzakov988 Год назад
i really like that thats the first youtube project thats works without error, thank you sir
@yutube8657
@yutube8657 18 дней назад
now i can not agree it dosent wor to me
@100mikedaniel6
@100mikedaniel6 2 года назад
Stay on the upload grind!
@NeuralNine
@NeuralNine 2 года назад
one video every other day! 💪🏻
@AlexMuseMatrix
@AlexMuseMatrix 3 месяца назад
Try 4 videos Every day, It's a great schedule 😎@@NeuralNine
@exxavier1695
@exxavier1695 8 месяцев назад
I love the project it was very useful and helpful thanks
@tsmghost
@tsmghost 2 года назад
Already made that but still learnt something new❤️❤️❤️
@theminecrafttree8913
@theminecrafttree8913 2 года назад
nice flex
@rodinicen689
@rodinicen689 3 месяца назад
Very nice video! More of this! :D
@user-wv1kr2pz1q
@user-wv1kr2pz1q Год назад
Interesting explanation ❤
@sarveshsargunan4914
@sarveshsargunan4914 Год назад
i learned a lot from this video and i did it myself as well
@tortu_nashe
@tortu_nashe 10 месяцев назад
nice vid liked n subed , made me feelike programming more
@himanshuranjansingh6134
@himanshuranjansingh6134 2 года назад
Thank you man🌻
@fayazshams-rd3ek
@fayazshams-rd3ek Год назад
Really really really Great i wish you more success ❤❤❤
@EBKCS_DHRUV_SHARMA
@EBKCS_DHRUV_SHARMA 11 месяцев назад
man i love you, best is what i think you are!!!!
@theminecrafttree8913
@theminecrafttree8913 2 года назад
the best tutorial ever bro u da best
@rezalapriani1001
@rezalapriani1001 2 года назад
i learn from your video, thanks you soo much
@dieelitezwerge7622
@dieelitezwerge7622 Год назад
thanks for another very nice video😇😉
@patibandlalatha7530
@patibandlalatha7530 6 месяцев назад
Very much helpful to the python learners
@lerserk
@lerserk Год назад
19:46 Its the lambda bro!! Thank you for this!
@maitruong7909
@maitruong7909 6 месяцев назад
Awesome! 10 points
@feliperodrigues3277
@feliperodrigues3277 Год назад
You're the best one to explain, ty so much man
@fzel1
@fzel1 5 месяцев назад
the amount of time he takes to build the calculator is so impressive
@RahulKumar-cm1sy
@RahulKumar-cm1sy Месяц назад
Thank you sir ❤
@zhangchill1616
@zhangchill1616 8 месяцев назад
Very simple Thank yous
@rushikeshmali3057
@rushikeshmali3057 2 месяца назад
Thanks for beautiful guidens
@kennethlourisombrog2149
@kennethlourisombrog2149 5 месяцев назад
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.
@Tom-ks9xl
@Tom-ks9xl 5 месяцев назад
Fantastic
@housemajaliwa
@housemajaliwa Год назад
Good stuff
@akellner2
@akellner2 7 месяцев назад
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.
@alirezaahmadivand831
@alirezaahmadivand831 2 года назад
Thanks a lot 🙏
@piklif5278
@piklif5278 Год назад
this helped me so mauch thax
@KatherineHunt-bz9fg
@KatherineHunt-bz9fg 6 месяцев назад
Learning python on a calculator
@abhinavgangwar4690
@abhinavgangwar4690 Месяц назад
Thats a classic chad move
@akshar088
@akshar088 4 месяца назад
amazing
@evoamer2686
@evoamer2686 5 месяцев назад
You have made me switch from C# to python my friend
@paulmwangi270
@paulmwangi270 Год назад
The tutorial was topnotch
@davidianmusic4869
@davidianmusic4869 9 месяцев назад
Thanks!
@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.
@tummatantewadonprasit639
@tummatantewadonprasit639 3 месяца назад
Tysm❤❤😊
@PCANDPOCO
@PCANDPOCO Месяц назад
thank you very much
@noir66146
@noir66146 2 года назад
my kind of tutorial
@flowereye3720
@flowereye3720 2 года назад
Thank you
@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 Год назад
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 9 месяцев назад
You need to implement a tree
@sepgorut2492
@sepgorut2492 2 года назад
Computerphile has an interesting approach to evaluating equations using functional programming: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7tCNu4CnjVc.html
@Victory-py7lp
@Victory-py7lp 3 месяца назад
Can someone explain why he uses the .delete first before the .insert? What does that do?
@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)
@sianbunny7724
@sianbunny7724 3 месяца назад
thnx man 🙏
@yoonesaghtaii8991
@yoonesaghtaii8991 4 месяца назад
thanks bro❤
@svetlanadelrey973
@svetlanadelrey973 7 месяцев назад
i would love if u explained what are you doing in ur actions
@user-qt4jh1lq6s
@user-qt4jh1lq6s 3 месяца назад
Thanks
@Void-Dev
@Void-Dev Год назад
For the buttons why not just use a definition?
@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 10 месяцев назад
@@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 9 месяцев назад
thank you so much it works@@TheRealStrider
@anirudhpm7155
@anirudhpm7155 Год назад
How can i add √ and on off button could you please help me.
@swarnarekha578
@swarnarekha578 2 года назад
0:42 when he said nonsense haha
@iumamaiftikhar
@iumamaiftikhar Год назад
sir i have a problem on line 5 iwrote it correct what should i do
@support_gaza
@support_gaza Год назад
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 😅
@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 Год назад
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 Месяц назад
@@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?
@therumblemain
@therumblemain 9 месяцев назад
so usefull and hepfull I subsribed this is my 2nd videio watching
@Al_X-2005
@Al_X-2005 4 месяца назад
Now that I can make custom buttons I can finally create the Calculator 2
@ethan_haymore3907
@ethan_haymore3907 3 месяца назад
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
@nellcid7909
@nellcid7909 Год назад
how to fix "text_result" is not defined error?
@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
@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
@HardeepSingh-ec4zq
@HardeepSingh-ec4zq 3 месяца назад
How can I add percentage button in this program
@caw986
@caw986 Год назад
hi good video all in all but the code keeps on throwing the error message at me when i perform any calculations
@Knowmemelife
@Knowmemelife 8 месяцев назад
Brow what will I do if on calculator I click 1 and the result is always calculation
@ernurernur303
@ernurernur303 Год назад
hey guys , how to add backspace function ? if you know pliss
@user-pm5bx5tg4g
@user-pm5bx5tg4g 4 месяца назад
After lambda add to command is not showing in blue colour
@frigontech
@frigontech Год назад
20:24, do equals without the lambda
@Tom-ks9xl
@Tom-ks9xl 5 месяцев назад
What interface are you using? Looks very good. The standard IDE isn't as nice as this
@N7ShepardSR
@N7ShepardSR 4 месяца назад
PyCharm its really good
@Tom-ks9xl
@Tom-ks9xl 4 месяца назад
Thank you i found it and installed it right onto linux. It's a very nice interface and handy.
@harshalpatil2618
@harshalpatil2618 9 месяцев назад
Super vdo
@SnowNight
@SnowNight Год назад
intro music name?
@leadgebrat9880
@leadgebrat9880 Год назад
The delete function is not working... Gives an Attribute error
@support_gaza
@support_gaza Год назад
How to delete one number?
@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
@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
@Hunter-kd4gi
@Hunter-kd4gi 5 месяцев назад
SyntaxError: expected 'except' or 'finally' block
@MMMdragon
@MMMdragon 23 дня назад
when you put root = tk.Tk() it worked perfectly for you but for me it's says AttributeError: module 'tkinter' has no attribute 'tk'
@Cheezou.
@Cheezou. 2 года назад
Where is the code , i wanna compare with mine pls
@speedev
@speedev 2 года назад
Thx.
@NeuralNine
@NeuralNine 2 года назад
^^
@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 9 месяцев назад
And also there should ve back space
@reskretny20
@reskretny20 6 месяцев назад
he looks like Nacho from Better call Saul
@skitmc5842
@skitmc5842 4 месяца назад
17:17 (just a marker so i can skip back into the video without losing where i was before)
@affenkratzer
@affenkratzer 4 месяца назад
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 3 месяца назад
Thank you so much.
@Soo-qd1co
@Soo-qd1co 3 месяца назад
thank buddy 🙏
@Victory-py7lp
@Victory-py7lp 3 месяца назад
Can you please explain why he .delete came before the .insert?
@affenkratzer
@affenkratzer 3 месяца назад
@@Victory-py7lp because of the grid placement you need to change it
@unknown-cz5yh
@unknown-cz5yh Год назад
error is occuring when i am adding 1+1 how to solve this problem
@AnthonyKenny-wl5ud
@AnthonyKenny-wl5ud Год назад
Really enjoyed this, thanks! All of the buttons are present and in the correct spot, but when I click key, the text "calculation" appears and not the actual digits. Any ideas?
@soufatldude700
@soufatldude700 2 месяца назад
do you need pycharm for this, or can you use the normal python application?
@reaction_124
@reaction_124 Месяц назад
hi gojo kun
@soufatldude700
@soufatldude700 Месяц назад
@@reaction_124 Nah i'd win.
Далее
Tkinter Beginner Course - Python GUI Development
38:59
Просмотров 484 тыс.
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,1 млн
Olive can see you 😱
01:00
Просмотров 9 млн
ОБНОВАА?? ЛУТАЕМ МЕГАЯЩИКИ
3:12:14
Просмотров 319 тыс.
Build this JS calculator in 15 minutes! 🖩
15:20
Просмотров 391 тыс.
Python calculator app 🖩
15:08
Просмотров 68 тыс.
I made Games with Python for 10 Years...
28:52
Просмотров 263 тыс.
5 Mini Python Projects - For Beginners
1:41:08
Просмотров 2,8 млн
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Просмотров 1,5 млн
5 Good Python Habits
17:35
Просмотров 395 тыс.
ASMR Programming - Calculator App Coding - No Talking
34:06
iPhone 16 - КРУТЕЙШИЕ ИННОВАЦИИ
4:50
FullHD в 8К БЕЗ ПОТЕРЬ? |РАЗБОР
20:42