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

Configuration

Given this HTML/JSON fragment:

<py-config>
    {
      "interpreter": "micropython",
      "files": {
        "arrr.py": "/arrr.py"
      }
    }
</py-config>

We're able to configure various things:

If you "view source" for this page, you'll see we ensure the Arrr Python module is copied over to the filesystem. Just import it, as usual, to make use of it in your code:

<py-script>import arrr

text = "Hello there, from MicroPython running in the browser!"
pirate_text = arrr.translate(text)

print(pirate_text)
</py-script>
import arrr text = "Hello there! It's MicroPython. Running in the browser!" pirate_text = arrr.translate(text) print(pirate_text)

Once again, "view-source" and see for yourself?