Last active
August 29, 2015 14:26
-
-
Save johnjjung/ce2be920daeec71ba721 to your computer and use it in GitHub Desktop.
Beagle Bone Kivy GUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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