The CircuitPython code on your board detects when the files are changed or written and will automatically re-start your code. This makes coding very fast because you save, and it re-runs.

However, you must wait until the file is done being saved before unplugging or resetting your board! On Windows using some editors this can sometimes take up to 90 seconds, on Linux it can take 30 seconds to complete because the text editor does not save the file completely. Mac OS does not seem to have this delay, which is nice!

This is really important to be aware of. If you unplug or reset the board before your computer finishes writing the file to your board, you can corrupt the drive. If this happens, you may lose the code you've written, so it's important to backup your code to your computer regularly.

To avoid the likelihood of filesystem corruption, use an editor that writes out the file completely when you save it. Check out the list of recommended editors below.

Recommended editors

Recommended only with particular settings or add-ons

  • vim / vi safely writes all changes. But set up vim to not write swapfiles (.swp files: temporary records of your edits) to CIRCUITPY. Run vim with vim -n, set the no swapfile option, or set the directory option to write swapfiles elsewhere. Otherwise the swapfile writes trigger restarts of your program.
  • The PyCharm IDE is safe if "Safe Write" is turned on in Settings->System Settings->Synchronization (true by default).
  • If you are using Atom, install the  fsync-on-save package or the language-circuitpython package so that it will always write out all changes to files on CIRCUITPY.
  • SlickEdit works only if you add a macro to flush the disk.
The editors listed below are specifically NOT recommended!

Editors that are NOT recommended

  • notepad (the default Windows editor) and Notepad++ can be slow to write, so the editors above are recommended! If you are using notepad, be sure to eject the drive
  • IDLE in Python 3.8.0 or earlier does not force out changes immediately
  • nano (on Linux) does not force out changes
  • geany (on Linux) does not force out changes
  • Anything else - Other editors have not been tested so please use a recommended one!

This guide was first published on Dec 19, 2017. It was last updated on 2021-11-16 19:17:38 -0500.

This page (Recommended Editors) was last updated on Nov 28, 2021.

Text editor powered by tinymce.