Skip to content

Instantly share code, notes, and snippets.

@kived
Created April 15, 2016 20:19
Show Gist options
  • Save kived/b72eae147581d58a4f66c8c11a973e29 to your computer and use it in GitHub Desktop.
Save kived/b72eae147581d58a4f66c8c11a973e29 to your computer and use it in GitHub Desktop.
Kivy: Android unicode test
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import StringProperty
from os.path import join, dirname
root = '''
Button:
text: app.filetext
on_release: app.loadfile()
'''
class TestApp(App):
filetext = StringProperty('Press Me')
def build(self):
return Builder.load_string(root)
def loadfile(self):
with open(join(dirname(__file__), 'unicode.txt'), 'rb') as f:
text = f.read().decode('utf8').rstrip()
self.filetext = text
if __name__ == '__main__':
TestApp().run()
© © © ©
© © © © ©
© © © ©
© © © © ©
© © © ©
© © © © ©
© © © ©
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment