Probably the first tutorial that I'm following along all the way through without quiting before it ends.. really straight forward, short videos, nice approach. Amazing man! Thanks for that. Will definitelly check your other Python videos as well. Wish you the best!
Hey Tim - thanks for making this series as we use kivy at school. Would you have any idea on how to transfer data between different windows (screens) in kivy?
Could you please explain why you didn't use these pointy brackets on WindowManager but on the other two you did? I'm trying to figure out when to use what in general :)
i had learn a lot with this tutorial, thanks so much for upload it, i have been looking for something like this, now i can use python for somthing xdxd
Hi Tim, great video! How would you create a transition without a button? For example, hold one screen for 60 sec then auto transition to the next screen? Thanks!
@Tech With Tim, How do you do if you have multi pages with the same structur, but with different informations? Is it possible to have one screen in .kv and replace just the values (like text or others)?
I would love to see how to put the logic of password check inside python instead of inside the kivy language file, so that we can learn to keep style and logic separted
Hey Tim. Lovely video. I have a question though. Let us say we have both username and password, how do you make the condition for it to read individually?
Thanks for the tutorial! But i have a question: can i set the name of window in .py file? Not using kv language. Is it even possible to create multiple windows in .py?
Hi Tim, you are much better at explaining kivy as any Course on kivy i bought on udemy. So thank you for that. The more I see from kivy the more I feel it is not that great. Many things seem overly complicated and even the logic in the code differs quite from that of python, so it is more like learning an entire new language. Also there are a lot of inconsistencies and same commands sometimes do not accept the same style, which makes it very frustrating. Sometimes you can use "=" but most of the time you have to use ":" . The documetation on it is very poor as well and it seems to give only very specific or far feched examples. Connecting it with actual python code is not intuativ at all. And the fact that you can only make an installation of that App on you phone with ubunty... What do you think about kivy? Is it actually worth learning?
I do not like it, as well. I wanted something like CSS. i might explore PyQt and drop Kivy. Just as you said, everything feels overly complicated. Proabably that is why it is not as popular as PyQt. It's a bummer though, I wanted something written completely in Python which Kivy is. PyQt has C++ code under the hood.
Hi Tim, I noticed you only imported Builder this time, does this automatically include the GridLayout, Label, and other widgets you imported separately before?
why do you need to use equal signs if you use 'app.root.current = 'second' or root.manager.transition.direction = 'left'' while the rest is different??
from where did you learn kivy? Just by reading the docs? I found them very confusing, (specially considering that I have no previous experience with GUI langs or Kivy). Does anyone recommend a course?
hello, nice vid but for some challenge, do you know if there is a way to switch screen with a speech recognition on a defined key word? (I need help in fact ^^)
hi what if an app requires more than 10 pages and each having many lines of code, Like if i want to create an ecommerce app? I am able to create basic small apps but if i try to create bigger apps my codes gets dirty!
Hi I am getting the following error when i try to switch screen by clicking and releasing submit button. " AttributeError: 'NoneType' object has no attribute 'transition'".
How to pass the values from one screen to another ex:scr1 has a text input with my name and when I click the submit button it has to move to the next screen and print the previous screen input my name
I had the same issue, try going to your console (Console in your PyCharm) and run this... python -m pip install docutils pygments pypiwin32 kivy_deps.sdl2==0.1.* kivy_deps.glew==0.1.* python -m pip install kivy_deps.gstreamer==0.1.* You may be missing a few files, worked for me
Anyone have any idea why we do *app.root.current = "second"* and use the *=* operator? It really through me off here as we've only been using *:* in our .kv files as an *=* operator.
Hi, I was practicing this tutorial. In kv file, I gave id: pass for TextInput: and the code wasn't running. In console it said invalid syntax. Why we cannot use pass as id? is this reserved word for kv?
I don't understand it doesn't work when i try to import the file, I even copied all the part from his website and i get raise AttributeError AttributeError
I am using python 2.7 with kivy so when I put in the logic in the kv file like this: on_release: "second" if passw=="khiz" else "main" The submit button doesn't do anything at all. I guess because the passw.text would be returned as a unicode value. This happens a lot with python 2.7. What would be the best way to overcome this?
@@TechWithTim I have a bit of code that I wrote in 2.7 and would like to use that. Plus, I find compiling python 2.7 applications easier. I don't like 2.7.
Did you replacing the "second" with app.root.current = "second". Also, I think it should be passw.text and not just passw. I am just guessing here. Please reply if it did help. Thanks
If I do it this way (using the kv file to create the screens) is there a way to change screens from the python file? I've tried using WindowManager.current = "second" and ScreenManager.current = "second", but it doesn't work. Can anyone please help me?
from kivy.app import App from kivy.lang import Builder kv = Builder.load_file("my.kv") class MyApp(App): def build(self): return kv if __name__ == "__main__": MyApp.run() Hi, for the above code I am getting a error, TypeError: run() missing 1 required positional argument: 'self' can anyone help me with this ?
I keep getting an error saying "[WARNING] [Lang ] The file C:\Users\Dell\PycharmProjects\MyNEAapp\my.kv is loaded multiples times, you might have unwanted behaviours. " I have the exact code as you however I have added an extra screen. Can anyone help?
does not work for me I got File "C:\Users\jorda\anaconda3\lib\site-packages\kivy\factory.py", line 146, in __getattr__ raise FactoryException('Unknown class ' % name) FactoryException: Unknown class My code if copied off your website
Guys I am stuck. I follwed the videos several times and even stated over and cut and pasted code from website I am still getting the following errors: Traceback (most recent call last): File "C:/Users/jscot/Kivy Turtuial 2/main.py", line 5, in kv = Builder.load_file("my.kv") File "C:\Python\Python38\lib\site-packages\kivy\lang\builder.py", line 304, in load_file return self.load_string(data, **kwargs) File "C:\Python\Python38\lib\site-packages\kivy\lang\builder.py", line 402, in load_string widget = Factory.get(parser.root.name)(__no_builder=True) File "C:\Python\Python38\lib\site-packages\kivy\factory.py", line 145, in __getattr__ raise FactoryException('Unknown class ' % name) kivy.factory.FactoryException: Unknown class Process finished with exit code 1 Can anyone help?
Happened with me, so I redid the kv file. Edit: I just checked and I think I might have found the cause of the problem. The load file statement needs to be after the definition of the classes of main window and window manager.If it is before that, it won't work. I have no idea why it is like that, so sorry I can not explain.
will you plzz make a video on changing button sizes in kv file. not happening with me Main file code: from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import Screen, ScreenManager from kivy.uix.button import Button from kivy.uix.widget import Widget from kivy.lang import Builder class MainWindow(Screen): pass class SecondWindow(Screen): pass class ThirdWindow(Screen): pass class FourthWindow(Screen): pass class WindowManager(ScreenManager): pass kv = Builder.load_file("my.kv") class TestApp(App): def build(self): return kv if __name__ == "__main__": TestApp().run() test.kv file code # : # Button: # text:"See" WindowManager: MainWindow: SecondWindow: : name: "Main" GridLayout: cols:1 GridLayout: cols: 2 # Label: # text: "Password" # TextInput: # id: pa # multiline: True Button: text: "Enter New Student Details" size_hint: [4] on_release: app.root.current = "second" root.manager.transition.direction = "left" : name: "second" Button: text:"Go Back" on_release: app.root.current = "Main" root.manager.transition.direction = "right" Error: Traceback (most recent call last): File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 700, in _apply_rule setattr(widget_set, key, value) File "kivy\weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__ File "kivy\properties.pyx", line 497, in kivy.properties.Property.__set__ File "kivy\properties.pyx", line 1356, in kivy.properties.ReferenceListProperty.set File "kivy\properties.pyx", line 1345, in kivy.properties.ReferenceListProperty.check ValueError: Button.size_hint value length is immutable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/Users/adity/OneDrive/Documents/Coding/python/projects/smallgame.py", line 35, in TestApp().run() File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\app.py", line 828, in run self.load_kv(filename=self.kv_file) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\app.py", line 599, in load_kv root = Builder.load_file(rfilename) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 301, in load_file return self.load_string(data, **kwargs) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 405, in load_string rule_children=rule_children) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 657, in _apply_rule root=rctx['ids']['root'], rule_children=rule_children) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\uix\widget.py", line 469, in apply_class_lang_rules rule_children=rule_children) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 538, in apply rule_children=rule_children) File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 707, in _apply_rule e), cause=tb) kivy.lang.builder.BuilderException: Parser: File "c:\Users\adity\OneDrive\Documents\Coding\python\projects\test.kv", line 28: ... 26: Button: 27: text: "Enter New Student Details" >> 28: size_hint: [4] 29: on_release: 30: app.root.current = "second" ... ValueError: Button.size_hint value length is immutable File "C:\Users\adity\AppData\Local\Continuum\anaconda3\lib\site-packages\kivy\lang\builder.py", line 700, in _apply_rule setattr(widget_set, key, value) File "kivy\weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__ File "kivy\properties.pyx", line 497, in kivy.properties.Property.__set__ File "kivy\properties.pyx", line 1356, in kivy.properties.ReferenceListProperty.set File "kivy\properties.pyx", line 1345, in kivy.properties.ReferenceListProperty.check (base) C:\Users\adity\OneDrive\Documents\Coding\python\projects>
You started this video series with a question : How to create a mobile app with python? You have not answered this question by making an example app with the best functions and methods avaiable with Kivy. It was the wastage of your time and ours. Even after 10 Tutorials, I do not know how to create a mobile app with Kivy in the best way.