from kivy.app import Appfrom kivy.uix.button import Buttonfrom kivy.core.audio import SoundLoaderclass FartApp(App): def build(self): return Button(text="Fart", font_size=150, on_release=self.fart) def fart(self, *args): fart = SoundLoader.load("fart.wav") if fart: fart.play()if __name__ == "__main__": FartApp().run()
from kivy.app import Appfrom kivy.uix.button import Buttonfrom kivy.core.audio import SoundLoaderfrom kivy.lang import BuilderBuilder.load_string("""<ButtWidget>: on_release: app.fart() Image: source: "butt.png" height: self.parent.height width: self.parent.width allow_stretch: True keep_ratio: False""")class ButtWidget(Button): passclass FartApp(App): def build(self): return ButtWidget() def fart(self, *args): fart = SoundLoader.load("fart.wav") if fart: fart.play()if __name__ == "__main__": FartApp().run()
from kivy.base import runTouchAppfrom kivy.uix.image import AsyncImageif __name__ == "__main__": zmann = AsyncImage(source="http://www.yourewinner.com/index.php?action=dlattach;attach=792;type=avatar") runTouchApp(zmann)