Skip to content

Instantly share code, notes, and snippets.

@johnjjung
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnjjung/ce2be920daeec71ba721 to your computer and use it in GitHub Desktop.
Save johnjjung/ce2be920daeec71ba721 to your computer and use it in GitHub Desktop.
Beagle Bone Kivy GUI
'''
Vending Machine GUI script
================
Kivy GUI script to run basic scripts
'''
import kivy
kivy.require('1.0.7')
from kivy.animation import Animation
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
import os
class Actions(App):
def runscript1(self, instance):
# path to script you want to execute
path = 'echo scriptpathhere1'
os.system(path)
def runscript2(self, instance):
# path to script you want to execute
path = 'echo scriptpathhere2'
os.system(path)
def build(self):
# Use
# http://kivy.org/docs/api-kivy.uix.gridlayout.html
layout = GridLayout(cols=2)
layout.add_widget(Button(text='Dispense', on_press=self.runscript1,font_size=36))
layout.add_widget(Button(text='Return', on_press=self.runscript2,font_size=36))
return layout
if __name__ == '__main__':
Actions().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment