Created
April 15, 2016 20:19
-
-
Save kived/b72eae147581d58a4f66c8c11a973e29 to your computer and use it in GitHub Desktop.
Kivy: Android unicode test
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
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() |
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
© © © © | |
© © © © © | |
© © © © | |
© © © © © | |
© © © © | |
© © © © © | |
© © © © |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment