Skip to content

Instantly share code, notes, and snippets.

@ToferC
Created January 4, 2015 03:06
Show Gist options
  • Save ToferC/0930fbb7e4c41c349e76 to your computer and use it in GitHub Desktop.
Save ToferC/0930fbb7e4c41c349e76 to your computer and use it in GitHub Desktop.
letters_for_meme.py
# coding: utf-8
import ui
import speech
import sound
def button_tapped(sender):
# Get the button's title for the following logic:
'@type sender: ui.Button'
t = sender.title
global shows_result
# Get the labels:
label = sender.superview['label1']
if t in 'abcdefghijklmnopqrstuvwxyz'.upper():
# Append number:
label.text += t
elif t == 'AC':
# Clear All
label.text = ''
elif t == 'espace':
# add a space
label.text += ' '
elif t == 'Del':
# Delete the last character:
label.text = label.text[:-1]
if len(label.text) == 0:
label.text = ''
elif t == 'Jou':
phrase = ' plus '.join(label.text)
phrase2 = '{} fait {}'.format(phrase, label.text)
speech.say(phrase2.lower(), 'Fr-fr', 0.0)
if __name__ == '__main__':
v = ui.load_view('letters_for_meme')
v.present('sheet')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment