The Carousel can be used to create a slide show. Here, we will have a 1-second delay between each slide.
Since this is an application, we need the App class. The Carousel widget is the super class of the root. We use the Clock to create a 1-second timer.
The root is based on Carousel. The update() function runs the Carousel's load_next() function to load the next slide.
In the build() of the app, a title is set and a continuous 1-second timer is started.
# ex56.py from kivy.app import App from kivy.uix.carousel import Carousel from kivy.clock import Clock class Ex56(Carousel): def update(self, dt): self.load_next() class Ex56App(App): def build(self): self.title = 'Carousel Example' ex56 = Ex56() Clock.schedule_interval(ex56.update, 1) return ex56 if __name__ == '__main__': Ex56App().run()
In the kv file, a dynamic class MyImage is created so the images are stretched.
For the root, the direction of Carousel is 'right' and looping is True. Here, we have the first 2 images.
The next 3 slides are of images p3, p4 and p5.
# ex56.kv <MyImage@Image>: keep_ratio: False allow_stretch: True <Ex56>: direction: 'right' loop: True MyImage: source: 'p1.png' MyImage: source: 'p2.png' MyImage: source: 'p3.png' MyImage: source: 'p4.png' MyImage: source: 'p5.png'
Demo of App on Youtube.
Thank you for sharing,very nice information, good content
ReplyDeletekeep postingpython training, python online training,learn python online , learn python programming
Python:
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
https://www.emexotechnologies.com/online-courses/python-training-in-electronic-city/
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeletePython Training in electronic city
nice information for beginners.thank you.
ReplyDeletejavacodegeeks
welookups python
Sage 50 accounting software
ReplyDeleteHow to Reset Quickbooks Password?
Reset Quickbooks Password
Quickbooks Password change
Quickbooks won't open error
ReplyDeleteUICKBOOKS ERROR 3371 STATUS CODE 11118
Quickbooks online vs Quickbooks Desktop
Quickbooks error 9999
ReplyDeleteQuickbooks Error code 6000
Quickbooks Error 6000
Quickbooks Error 6000
Quickbooks Error code 9999
Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to find out if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated. apple hilfe berlin
ReplyDeleteFor the programming you must need the best support from your PC. But if you are suffering any kinds of issue with your laptop or pc then ITFUX24 can help you. They has the 7+ years of experience in repairing service. Take their computer reparatur service today and get discount form the first day!
ReplyDelete