Secondary Calculator Button Functions - Python Kivy GUI Tutorial #17

preview_player
Показать описание
In this video we'll build out secondary buttons for our calculator app with Kivy and Python.

So let's build out the "+/-", the ".", and the "back" buttons for our calculator.

The "+/-" button will toggle our textbox numbers positive or negative, the "." button will add a decimal to our number, and the "back" button will remove the last number from the text box.

These are pretty basic buttons and we should be able to knock them out in just a few minutes!
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Kivy Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

this is just so amazing. I am a 16 year old kid who is trying to learn how to code and your videos are helping me soo much. Your explanations are the best

falsettoandhighnotes
Автор

For every Button, one can also do
on_press: root.button_press(self.text)
since "self" under each "Button" refers to the Button in question in each case.
Great video series!

malcolmnooning
Автор

Keep going keep going man ! ... Such a GREAT person like you must be known by everyone .. You started to teach and help people and didn't stop and now look you have the GREATEST AND BIGGEST tkinter course on the internet and it's FREE .. and you didn't even stop you also making kivy with your usual passion on your beautiful face .. I really couldn't help not to write this message for you .. Oneday you will get what you deserve for all what you did for people and students like me for free ..

funnyanimals
Автор

Thank you for the awesome tutorials! One thing to note; the current code does not allow for two floats in the same equation because of the conditional to do nothing if there exists a "."

joephinazee
Автор

You can combine numbers and symbols into one function as well, just pass in the symbol/numper with the function in the function call. and the function should just add the variable to the end of the string, almost as you have done :)

roostersson
Автор

Nice one, I can't wait for next video with Kivy.

Have you ever used PyQt5? I find Kivy much more user friendly. :)

Thanks again!

Haitoshi
Автор

Great video tutorial on Kivy. I just learned Python and would love to put a GUI on my app projects. There is one thing that I would like to do in your calculator app. Affter validating the result by pressing the = button, can you code it so that the inputbox is cleared when a new number is entered to start a new calculation? In other words, eliminate extra press of 'clear' button. Thank you.

koollucian
Автор

Sir we can use eval function, no need to create these functions just pass the equation to the eval function

dheerajd
Автор

Woww. This is awesome.
Bro there is a small bug. How to fix it?
If we want to the calculation like 2.5 + 2.5 we can't do this. Coz we have written the code before in our dot() function. So that it won't allow to have multiple decimal point numbers. What to do in this case? Looking forward your reply. Thank you.

misfarsiddeek
Автор

Hi Professor I have a question.
For you which of Tkinter and Kivy must i learn?
I'm a student and I would like to start correctly.🤓

bassjunias
Автор

If you want to clean it up a little, you could change:
def remove(self):
prior= self.ids.calc_input.text
prior = previous[:-1]
self.ids.calc_input.text = previous
to this instead so it will replace the 0 when you remove the last character or sign:


def remove(self):
prior= self.ids.calc_input.text
prior= previous[:-1]
if previous == "":
self.ids.calc_input.text = "0"
else:
self.ids.calc_input.text = previous

bluidguy
Автор

Huh this Kivy is hell. But very good practice.

dekito
Автор

how does the computer know when you add a negative number to a positive one. You write -3+5. As far as Python knows, that should be -8. What am I missing?

Sergiu-eb
Автор

When did you do the -, X, / functions? Where can I find it?

jannesbecker
Автор

in the math sign function, can we pass self.text?? like math_sign(self.text). Thaks for the tutorials are awesome!

hernangaston
Автор

I know it has been a while, but what is the editor? my ears coulnd't get it. Thank you o/

iriarte
Автор

One thing I noticed is with the +/- button, if I enter 25-6-2, and press the +/- button, the textbox now becomes 2562. Something I'll try to figure out.

thomasnowak
Автор

John, kindly make a Django beginner series First explain concepts and then put into the project.

faizrehman
Автор

Do you know someone who is hiring python developer. Your are a great content creator.

MajesticRiderTales