This file contains hidden or 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
def hw(): | |
print("Hello world!") | |
This file contains hidden or 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
import os | |
os.environ["KIVY_BCM_DISPMANX_ID"] = "4" |
This file contains hidden or 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
import os | |
os.environ["KIVY_BCM_DISPMANX_ID"] = "4" | |
from kivy.app import App | |
from kivy.uix.button import Button | |
from kivy.clock import Clock | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.label import Label |
This file contains hidden or 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
class LabelD(Label): | |
def __init__(self,dictionary,key_string,**kwargs): | |
super(LabelD, self).__init__(**kwargs) | |
self.dictionary = dictionary | |
self.key_string = key_string | |
Clock.schedule_interval(self.update, 1 / 30.) | |
def update(self, *args): | |
self.text = str(self.dictionary[self.key_string]) |
This file contains hidden or 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
class MyApp(App): | |
def __init__(self,dictionary): | |
App.__init__(self) | |
self.dict_local = dictionary | |
def build(self): | |
layout1 = BoxLayout(orientation='horizontal',spacing=10) | |
layout1.add_widget(LabelD(self.dict_local,'counter',font_size=200)) | |
layout2 = BoxLayout(orientation='vertical', spacing=10) | |
layout2.add_widget(ButtonDIPO(self.dict_local,'counter',operator.add,1,text="+1",font_size=200)) |
This file contains hidden or 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
from multiprocessing import Process, Manager, Event | |
def display_process(dict_global, is_master, exit_event): | |
import os | |
if is_master: | |
os.environ["KIVY_BCM_DISPMANX_ID"] = "4" | |
else: | |
os.environ["KIVY_BCM_DISPMANX_ID"] = "5" | |
# kivy module imports go here |