Emojify your Python

Screen shot of Emojifier

I’ve been thinking of ways of sharing Python programs on Twitter and I’ve come up with something a bit crazy, but which might have other uses.

The micro:bit Python emojifier encodes and condenses Python programs using emojis. It also decodes them too, and turns strings of emojis back into full Python programs.

Many keywords are tokenised, in effect, into a single character. This means the programs take up less space, and so you could, for example, share longer programs in a tweet. I used carefully-chosen emojis so even the encoded programs can be read by humans. Our old friend the teleporting duck:

from microbit import *
import radio
radio.config(group=23)
radio.on()

while True:
    message = radio.receive()
    if message:
        display.show(Image.DUCK)
    if accelerometer.was_gesture('shake'):
        display.clear()
        radio.send('duck')

becomes:

πŸ”
πŸ“²πŸ“»
πŸ“»βš™(πŸ‘₯=23)
πŸ“»πŸ”›β†©
πŸ”
γ€°message = πŸ“».πŸ“₯
〰❓message:
γ€°γ€°πŸ“ΊπŸ’(πŸ–ΌπŸ¦†)
γ€°β“πŸ“³.was_🀟('πŸ₯€'):
γ€°γ€°πŸ“ΊπŸšΏ
γ€°γ€°πŸ“».πŸ“€('duck')

I think this might have other uses.

It may also encourage reluctant students to engage with coding concepts by presenting them in a new, but familiar visual language. The emojis are, in effect, a visual abstraction of programming concepts.

Programs written pictorially could appeal to those who struggle with reading or find large blocks of text hard to process, in a way not even block coding can manage,

Maybe students could even write Python programs using emojis. It might make Python more accessible to those who only have mobile devices.

This is very much optimised for Python on the BBC micro:bit, but perhaps it could be applied to other languages.

What do you think? Let me know!

This entry was posted in computers, microbit and tagged , , , . Bookmark the permalink.

Leave a Reply