Cameron Laird's personal notes on MicroPython

MicroPython is both a small circuit board, and a dialect of Python which runs natively on that board (for an appropriate sense of 'natively'). MicroPython is quite wonderful. Here are a few questions you're likely to have early in your MicroPython explorations:

What I/O does MicroPython support?
Three:
Can I control garbage collection?
Quite nicely: gc is a simple module that closely aligns with classic CPython gc. Is it possible to "timeout" gc? No, as desirable as that sounds, at least superficially, there's no programmatic way to achieve it within MicroPython.
How else does MicroPython differ from the usual CPython?
Recognize you can immediately try out MicroPython for yourself through this online REPL. While the differences between CPython and MicroPython are substantial, writing straightforward actual applications in MicroPython feels quite familiar to those experienced with Python 3--well, I feel comfortable.

Module support is limited: no datetime (although machine might give hardware-specific essentials), no random, no weakref, ..., and plenty of others which I often tell newcomers to (C)Python to study, so they don't mis-implement them on their own. Note that MicroPython does offer slimmed-down versions of many common facilities, including reduced versions of re, json, time, collections, ...

[More details about Unicode, json, numerics, varieties of different MicroPythons including BBC's MicroBit, ...]


Cameron Laird's index to MicroPython/claird@phaseit.net