Created
January 11, 2022 19:10
-
-
Save ahaym/eb48db23c3fc28ad1a9d42a288d839bd to your computer and use it in GitHub Desktop.
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
keyLabel = Label('>',100, 50, font='monospace', align='center') | |
def onKeyPress(key): | |
if key == 'backspace': | |
keyLabel.value = keyLabel.value[0:-1] | |
elif key == 'space': | |
keyLabel.value += ' ' | |
elif key == 'enter': | |
eval(keyLabel.value[1:]) | |
keyLabel.value = '>' | |
else: | |
keyLabel.value += key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment