In this video I’ll show you how to create a carousel with Kivy and Python.
Carousels are great for creating image slider type apps, or really anything you’d like to put on separate panels that can then be slid across to.
In this video I’ll show you how to create an Image Carousel for pictures that are sitting on your computer, as well as pictures sitting on the Internet!
Python Code: carousel.py
GitHub Code: carousel.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
# Designate Our .kv design file
Builder.load_file('carousel.kv')
class MyLayout(Widget):
pass
class AwesomeApp(App):
def build(self):
return MyLayout()
if __name__ == '__main__':
AwesomeApp().run()
Kivy Design Code: carousel.kv
GitHub Code: carousel.kv
<MyLayout> BoxLayout: orientation: "vertical" size: root.width, root.height Carousel: direction: "right" Image: source: "images/aspen1.jpg" AsyncImage: source: 'https://dv64b7ma0a00o.cloudfront.net/wp-content/uploads/2020/12/accordions-for-kivy-python-kivy.jpg' Image: source: "images/aspen2.png" Image: source: "images/aspen3.jpg"

Add comment