{ "interpreter": "micropython", "files": { "arrr.py": "arrr.py", "polyplug.py": "polyplug.py" } } Skip to main content

Arrr 🏴‍☠️

import arrr from polyplug import plug, update, receive @plug("#inputForm", "submit") def handle_form(event): """ Take the English input from the form, turn it into Pirate talk and update the DOM with the result. """ english = event.target.find("#english").value pirate_text = arrr.translate(english) output = event.target.find("#output") output.innerHTML = f"

{pirate_text}

" update("#output", output)