▶️ Watch Entire Kivy Playlist ✅ Subscribe To My RUclips Channel: bit.ly/37LrJ27 bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/37jtHoo
Thanks for that... Actually I was able to complete that project before that video.... But I just completed it only for your nice teaching... Thank you sir.....
I enjoyed this video and it was useful, but you could have just had passed the "+", "-", "*", and "\" operators into the button press function. Also you could have used self.ids.calc_input.text += f'{button}' instead of self.ids.calc_input.text = f'{prior}{button}. Edit: Also use eval.
No special Cyber Monday code? I saw your deal last year, and have been waiting for a couple of months to see if there would be one this year. I know that what you are offering is worth much more, especially with your regular RUclips discount code, but you can't blame a guy for being a cheapsk.... er... thrifty. :) I really admire your business plan/implementation. Thanks for sharing your knowledge.
Suppose you want to build a serious gui application say pdf viewer or any other application and you know tkinter, kivy, pyqt, qt, wxwidgets and electron. What would you use?Also which is your all round favourite gui framework/library ?
Thanks for this video series. I love it. But I have an easier solution. There is a python built-in function for this. The eval() function. It supports every basic math calculations included "(" , ")" and it can also deal with more than 2 numbers in the same time. Anyway... thanks for your videos, helped a lot.
I usually pause the video at the beginning and try to come up with the solution, then I watch it. I used this function: def equals(self): self.ids.calc_input.text = str(eval(self.ids.calc_input.text)) I have no "old school calculator" at home, so I cannot check teyao's answer, but I guess he's right. However, Google's calculator seems to use "eval" too.
In the kv file we placed a number inside the parentheses for each number button for the on press function, but as soon as I click python throws an error and the application quits despite copying your code exactly. So why this does not work?
HELP please...how would one define a boolean function in the py file and call it as root.funcname when the '=' button is pressed? I tried def __init__(self): and then store the bool value of the variable but this results in segmentation error. what's the correct way to define it? thanks in advance. I am new to kivy but going thru every kivy video that you have posted on YoutTube. Great tutorials! Much thanks.
Problem solved. Calculator app now working well as I like. After validating the result following press of '=' button, I don't need to press 'clear' to erase the result in the text input box to enter a new formula. Now, I just click any number and it goes in the input box.
When I press '=', it doesn't calculate anything, the calculator stays the same, waiting for other actions... I begin to press other buttons and press '=' again, and it gives me the mistake "ValueError: invalid literal for int() with base 10: '5-9*5'" ... Why?
exec(_kvlang_.co_value, idmap) File "c:\Users\hamza\Desktop\learn ame.kv", line 5, in on_press: root.button_press(1) File "kivy\\weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy._getattr_AttributeError: 'BoxLayout' object has no attribute 'button press' Plz help me
▶️ Watch Entire Kivy Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/37LrJ27 bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶️ Get The Code
bit.ly/37jtHoo
Thanks for that... Actually I was able to complete that project before that video.... But I just completed it only for your nice teaching... Thank you sir.....
I enjoyed this video and it was useful, but you could have just had passed the "+", "-", "*", and "\" operators into the button press function. Also you could have used self.ids.calc_input.text += f'{button}' instead of self.ids.calc_input.text = f'{prior}{button}. Edit: Also use eval.
As Always Awesome Person and Awesome Teaching Congratulations Please Keep it up
Thanks!
Thank you so much, Man! You are The Best Teacher!😊 Great KivyMD Python tutorial for all!
Glad you enjoyed it!
I kept screaming noooooo use the eval()...😂😂 Thanks for the effort
Thank you, Best teacher ever! haha, My all-time favorite part 0:00 0:20 0:34 , At that moment I be like :)
Ha thanks
No special Cyber Monday code? I saw your deal last year, and have been waiting for a couple of months to see if there would be one this year. I know that what you are offering is worth much more, especially with your regular RUclips discount code, but you can't blame a guy for being a cheapsk.... er... thrifty. :) I really admire your business plan/implementation. Thanks for sharing your knowledge.
Ha, no cyber monday sale this year...
Perhaps this idea could simplify the code:
formula = "1+2/3"
print(f'{eval(formula)}')
Suppose you want to build a serious gui application say pdf viewer or any other application and you know tkinter, kivy, pyqt, qt, wxwidgets and electron. What would you use?Also which is your all round favourite gui framework/library ?
It depends entirely on the app and what it needs to do. I don't have a favorite. These are just tools, you use the tool that the job best needs...
Best lector !
Thanks!
Thanks for this video series. I love it. But I have an easier solution. There is a python built-in function for this. The eval() function. It supports every basic math calculations included "(" , ")" and it can also deal with more than 2 numbers in the same time. Anyway... thanks for your videos, helped a lot.
1+2*3 = 7, but when using calculator, 1+2*3 = (1+2)*3 = 9. I don't think it's a good idea to use eval().
@@teyao eval('1+2*3') returns 7 thats correct
@@tibssy1982 You are right about eval(), However, find a normal calculator and press '1', '+', '2', '*', '3', that will be 9.
I usually pause the video at the beginning and try to come up with the solution, then I watch it.
I used this function:
def equals(self):
self.ids.calc_input.text = str(eval(self.ids.calc_input.text))
I have no "old school calculator" at home, so I cannot check teyao's answer, but I guess he's right. However, Google's calculator seems to use "eval" too.
@@johannes-euquerofalaralema4374 Great Job bro. You have made the function so easy, and it's looks so clean 😀😀😀
Thanks for the tutorials they're great!
Can't you just say in your if statement name = f'{button}' instead of self.ids.calc_input.text
In the kv file we placed a number inside the parentheses for each number button for the on press function, but as soon as I click python throws an error and the application quits despite copying your code exactly. So why this does not work?
HELP please...how would one define a boolean function in the py file and call it as root.funcname when the '=' button is pressed? I tried def __init__(self): and then store the bool value of the variable but this results in segmentation error. what's the correct way to define it? thanks in advance. I am new to kivy but going thru every kivy video that you have posted on YoutTube. Great tutorials! Much thanks.
Problem solved. Calculator app now working well as I like. After validating the result following press of '=' button, I don't need to press 'clear' to erase the result in the text input box to enter a new formula. Now, I just click any number and it goes in the input box.
Hi, how could i change the output color, i tried putting color: 1, 1, 1, 1 under TextInput: in the kv file but it doesnt change anything....
0 dislikes fantastic!
Ha yep!
When I press '=', it doesn't calculate anything, the calculator stays the same, waiting for other actions... I begin to press other buttons and press '=' again, and it gives me the mistake "ValueError: invalid literal for int() with base 10: '5-9*5'" ... Why?
Maybe I do not have some necessary math libraries needed in this project?..
@@lusienda There are no math libraries needed, you have a typo in your code somewhere. Check it against the code in the video.
👍
👍
Why not using Eval()?
If memory serves, we do that in a future video
Plz tell how to download your code? Instead of copying it...
link to the code in the comment section pinned comment
Thanks
exec(_kvlang_.co_value, idmap)
File "c:\Users\hamza\Desktop\learn
ame.kv", line 5, in on_press: root.button_press(1)
File "kivy\\weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy._getattr_AttributeError: 'BoxLayout' object has no attribute 'button press'
Plz help me
0 dislikes fantastic!
Amazing!