Тёмный

Kivy Tutorial #9 - Navigation Between Multiple Screens 

Tech With Tim
Подписаться 1,6 млн
Просмотров 146 тыс.
50% 1

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

 

28 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 133   
@thomasgallasso1858
@thomasgallasso1858 4 года назад
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!
@RayCast-dz6tk
@RayCast-dz6tk Год назад
The best kivy tutorial you can find online
@kanishkbhattacharya8217
@kanishkbhattacharya8217 4 года назад
searched for this for a long time finally found it great video.
@janezvegan
@janezvegan 4 года назад
thank you for your representation of the kivy in python. It is really great clear and easy to understand
@znb5873
@znb5873 4 года назад
Thanks for the concise yet well-explained tutorials series! PS: @5:31 You just pressed Ctrl + tab, it allows you to navigate between windows
@StarFury2
@StarFury2 2 года назад
Super useful shortcut, by the way.
@user-sk4xb7fz4p
@user-sk4xb7fz4p 4 года назад
Im not native english speaker so I wrote direction with double R and spend like an hour to figure what the problem was great tutorieal
@adityajha1889
@adityajha1889 4 года назад
Thanks for the concise yet well-explained tutorials series! PS: @5:31 You just pressed Ctrl + tab, it allows you to navigate between windows true
@devinbrown9925
@devinbrown9925 Год назад
Tim for the win. Thanks for the tutorial.
@torswebster6856
@torswebster6856 4 года назад
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?
@dionysischala5320
@dionysischala5320 4 года назад
i have the same problem with you...
@paccooper3019
@paccooper3019 4 года назад
what I do is create another python file where I can access from any screen, and I store the values there
@micah2936
@micah2936 2 года назад
I spent 3 hours on this because the whole time I forgot ScreenManager in the class. I was so focused on the kivy file for 3 hours that i missed that.
@tuz6820
@tuz6820 4 года назад
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 :)
@caducoder
@caducoder 2 года назад
With the pointy brackets it's a rule. Without them, it's a root widget.
@QuransGems-zd1jd
@QuransGems-zd1jd 3 месяца назад
exactly what I needed!
@kohelet910
@kohelet910 4 года назад
Taking Python to the next level ! Amazing ! Thank you !
@goth14wx47
@goth14wx47 5 лет назад
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
@luigi2606
@luigi2606 4 года назад
Your information is good, i'm learning and your videos were my help... thanks
@happyman610
@happyman610 3 года назад
Thanks Tim, Is it possible to explain how you can pass the password value from main Screen to Second Screen ??
@kevinrobben1999
@kevinrobben1999 5 лет назад
Exelent series of tutorials
@jeevanjohal8194
@jeevanjohal8194 2 года назад
Thank you so much, This helps with my project!!
@dionysischala5320
@dionysischala5320 4 года назад
Hey Tim, i have a problem with transitioning data between different screen.Thank you in regards.
@101fiachra
@101fiachra 4 года назад
Thanks Tim you're a legend!
@karlyf7982
@karlyf7982 3 года назад
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!
@grendbelema
@grendbelema 4 года назад
thanks Tim, great work
@dami95ify
@dami95ify 4 года назад
@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)?
@andreinutu6391
@andreinutu6391 5 лет назад
I find a good idea for you to collaborate with the guys who made Programming hero, maybe adding a kivy topic in that app. Anyhow, nice work
@thedaht0
@thedaht0 3 года назад
Thanks to you the computer remained unharmed
@jongmagee
@jongmagee 4 года назад
How come the app.root.current can use an equal sign but everything else uses a colon. Is it because they're logic code instead of GUI code?
@Linuxovert
@Linuxovert 4 года назад
thanks for your comment.. it showed me the mistake i'm having that making my main window won't go the the second window
@davidtanner8058
@davidtanner8058 4 года назад
H
@Александр-р3э3м
@Александр-р3э3м 3 года назад
Great tutorial! Thanks!
@beppe9638
@beppe9638 2 года назад
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
@etasdemir
@etasdemir 4 года назад
Excellent tutorial thank you
@jonathanameyo3608
@jonathanameyo3608 3 года назад
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?
@iidf
@iidf 11 месяцев назад
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?
@neilrehani.1409
@neilrehani.1409 3 года назад
You helped me alot! Thx TWT!
@moriztrautmann8231
@moriztrautmann8231 4 года назад
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?
@marflage
@marflage 4 года назад
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.
@aatutahkola7005
@aatutahkola7005 3 года назад
how can i use both the my.kv file and a touch class we made in the previous video
@joergboettiger2255
@joergboettiger2255 4 года назад
Hi Tim, I noticed you only imported Builder this time, does this automatically include the GridLayout, Label, and other widgets you imported separately before?
@217-sritejrajulu6
@217-sritejrajulu6 5 лет назад
you are amazing tim im ur fan
@TechWithTim
@TechWithTim 5 лет назад
Thank you :)
@jorgefigueroa9661
@jorgefigueroa9661 5 лет назад
I'm guessing we can use a floatlayout if we wanted to??
@ApexGaara
@ApexGaara 5 лет назад
One question how long have you been learning "Programming" and how long did it take you to become comfortable "Intermediate" Stage in a language?
@TechWithTim
@TechWithTim 5 лет назад
I have a podcast that talks about my entire journey. Link is in the description, feel free to check it out.
@rutvikrana512
@rutvikrana512 5 лет назад
hey I do the same but got black screen instead ....... what should i do?
@mattytripps
@mattytripps 4 года назад
i keep getting No screen with name "screen name" i definately have the correct screen name so what is happing?
@mohamedjolti572
@mohamedjolti572 4 года назад
you probably create a property name after the name of the screen mean that you type the name:name for the TextInput
@ErickG
@ErickG 5 лет назад
Good stuff.
@andrewa471
@andrewa471 5 лет назад
What if you want to create UI elements at runtime ? For example I want a scrollable vertical layout of buttons generated for each user input.
@alaahoussen2914
@alaahoussen2914 3 года назад
Oh I find what I want Label: text: "Congratulations Pro Thanks too much"
@aatutahkola7005
@aatutahkola7005 3 года назад
also can i use the kv file and have variables as texts of elements so i can change them
4 года назад
We made ScreenManager a Class. Then, how can we change transition type, transition durations etc.? Internet shows something really different.
@OtroIngenieroMas
@OtroIngenieroMas 4 года назад
I got this error ('NoneType' object is not subscriptable) when trying to do kv = Builder.load_file("my.kv")
@altum5195
@altum5195 3 года назад
I got the same error and it turns out I was missing a tab in my .kv file. If you copy/paste the exact .kv file he provided it should solve your issue
@NiekHM
@NiekHM 3 года назад
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??
@LCB_Instituto
@LCB_Instituto 4 года назад
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?
@GhjattuVolpe
@GhjattuVolpe 5 лет назад
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 ^^)
@akshaygangwani9875
@akshaygangwani9875 2 года назад
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!
@dragonballzgt1989
@dragonballzgt1989 3 года назад
so how do you call functions from screen classes? after moving code into a screen root.functionName no longer works
@ahmedbadal3795
@ahmedbadal3795 5 лет назад
first view holla tim ....how many lang do you know and were did u learned from them ...are u in university
@TechWithTim
@TechWithTim 5 лет назад
Like 4-5 and yes
@watchmetype6445
@watchmetype6445 4 года назад
I copied all of the code as it is until 7:17, but I get this: NameError: name 'my' is not defined(on line 18) Please help me out
@msfmapper
@msfmapper 4 года назад
you applied the logic inside the kivy design file, is there a way to apply the same logic inside the python file?
@msfmapper
@msfmapper 4 года назад
the method i found to work is by creating global variables and passing information through them to different classes.
@originalgamer4962
@originalgamer4962 4 года назад
im having an attribute error that module object has no attribute load_file ? any solutions
@corporealhealth7331
@corporealhealth7331 4 года назад
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'".
@williamofdallas
@williamofdallas 3 года назад
me too, alas
@bharaths1396
@bharaths1396 4 года назад
Hey Is there any way to switch screens from python itself??? Please Help
@daivikbhatia5041
@daivikbhatia5041 5 лет назад
i wrote the same code but the Builder.load_file is giving a black screen. help!
@marflage
@marflage 4 года назад
For me, my grids were messed up.
@MohamedAyman-bn4ne
@MohamedAyman-bn4ne 4 года назад
hello, i have a problem with packing python files and kv files into one excutable file to run in windows. can you help me please ?
@dhakshnamoorthy8673
@dhakshnamoorthy8673 4 года назад
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
@joakimjocka8022
@joakimjocka8022 4 года назад
What if i want to retrive the password from sql database , can i use a variable to replace "tim" there?
@sainco3036
@sainco3036 5 лет назад
thanks.
@jjc9003
@jjc9003 4 года назад
How to check value in .kv file which is returned from method in .py file?
@sarveshpandey582
@sarveshpandey582 5 лет назад
I want to move textinput to centre of screen. How can I do this?
@antoberg
@antoberg 5 лет назад
Watch previous tutorials like Float Layout, you can use a porcentage to place ur items
@白衬衫-w2r
@白衬衫-w2r 4 года назад
Does anyone how to solve this problem "[CRITICAL] [Window ] Unable to find any valuable Window provider."
@kairo3726
@kairo3726 4 года назад
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
@aromaljosebaby9176
@aromaljosebaby9176 4 года назад
Could you do a tutorial on kivymd? coz there are literally NO good tutorials on kivymd
@kefiltonouewa
@kefiltonouewa 4 года назад
there is one check out this chanel (buildwithpython)
@threepwoot2327
@threepwoot2327 4 года назад
logical statements in the kv file hmm is there a better way around, to truly seperate logic from layout?
@msfmapper
@msfmapper 4 года назад
i was looking for the exact same thing, did you find a way?
@user-sg7yd5il3z
@user-sg7yd5il3z 3 года назад
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.
@kumaramit76
@kumaramit76 3 года назад
it isnt working for me :( it says WindowManager Class not identified :(
@59rashad
@59rashad 3 года назад
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?
@nejinii1353
@nejinii1353 Год назад
OMG thank you i had the same problem hahahha.
@isaacnewton4773
@isaacnewton4773 4 года назад
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
@adityajha1889
@adityajha1889 4 года назад
i got ValueError
@amirghasri6512
@amirghasri6512 Год назад
Hi tim
@shikharsingh2914
@shikharsingh2914 4 года назад
It's Showing Keyerror:'name' as i have used same concept, just help me out.
@khizerkhattak6061
@khizerkhattak6061 5 лет назад
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
@TechWithTim 5 лет назад
Don’t use 2.7
@khizerkhattak6061
@khizerkhattak6061 5 лет назад
@@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.
@marflage
@marflage 4 года назад
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
@mp3311
@mp3311 4 года назад
How can i import a Screen from another .py file?
@zakariaeaitdoukali7881
@zakariaeaitdoukali7881 5 лет назад
Hello Tim, I followed your Tutorial, and it's raising attribute error... can u help me
@marflage
@marflage 4 года назад
For me it was the same error, so I just redid the kv file. It was resolved.
@Tahir_CanKozan
@Tahir_CanKozan 2 года назад
How can ı make without .kv
@paccooper3019
@paccooper3019 4 года назад
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?
@paccooper3019
@paccooper3019 4 года назад
Nevermind, I did it
@johnanih56
@johnanih56 4 года назад
How do I contact you?
@pragyanchoudhury7366
@pragyanchoudhury7366 4 года назад
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 ?
@shreeshbahuguna1400
@shreeshbahuguna1400 4 года назад
try this:- MyApp().run()
@M45t3rJ4ck
@M45t3rJ4ck 2 года назад
if __name__ == "__main": MyApp().run()
@mihirbhudia4064
@mihirbhudia4064 4 года назад
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?
@dhruvlohar8859
@dhruvlohar8859 4 года назад
Just make sure u have a systematic id for each screen and on_press function for changing screens :)
@jasonlccima
@jasonlccima 4 года назад
I use spyder IDE and had that error when i run the script again. Just restart the kernel to start afresh before running.
@Jorddz
@Jorddz 3 года назад
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
@ashiaklanklan
@ashiaklanklan 3 года назад
I had the same issue. It was because i put the kv= statement before i defined the classes. When i moved it below them it ran.
@oussamasoudassi
@oussamasoudassi 3 года назад
Well, i'm late but just remove kv = and change return kv into return Bulder.load__file("My.kv")
@gameislife7375
@gameislife7375 Год назад
It always black screen
@scott8678
@scott8678 4 года назад
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?
@marflage
@marflage 4 года назад
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.
@Danieldbs09
@Danieldbs09 4 года назад
@@marflage unreal
@adityajha1889
@adityajha1889 4 года назад
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>
@sedloif2598
@sedloif2598 4 года назад
pip install PyFriday
@LORENZOCINQUEMANI
@LORENZOCINQUEMANI 6 месяцев назад
vai zio
@BiologyIsHot
@BiologyIsHot 3 года назад
Ugh that logic statement reads nothing like python which is kinda annoying.
@BiologyIsHot
@BiologyIsHot 3 года назад
Maybe a little like a list or dictr comprehension
@ricdelmar4961
@ricdelmar4961 3 года назад
It is standard python -- that is the ternary operator syntax
@sergeygladich3602
@sergeygladich3602 Год назад
OMG... it's so dificult language . i am furtrated after this video😟😟😟
@keshavgokhaledivine
@keshavgokhaledivine 3 года назад
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.
@oussamasoudassi
@oussamasoudassi 3 года назад
I'm sure you don't even have a good experince in programming
Далее
Kivy Tutorial #10 - Creating a Popup Window
7:21
Просмотров 135 тыс.
无意间发现了老公的小金库 #一键入戏
00:20
How To Practice Programming So You Actually Get Good
15:46
Kivy Tutorial #6 - FloatLayout for Dynamic Placement
12:25
Screen navigation in Kivy - ScreenManager()
24:00
Просмотров 9 тыс.
Vim Tips I Wish I Knew Earlier
23:00
Просмотров 74 тыс.
5 Tips To Organize Python Code
12:16
Просмотров 242 тыс.