Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Filesystem

The filesystem functionality is provided by the microbitFs library.

More info can be found in the microbitFs documentation.

Modules

During early testing of the filesystem functionality we received feedback about the process of adding modules to the editor. It was quite easy to mistakenly add a module to the code editor instead of the filesystem.

Without having a pre-learned context of what is a module and how it differs from a normal Python file, it can be difficult for users to know that they need to follow a different process to load modules vs their normal Python scripts.

To overcome this issue we've introduced the use of a "magic comment" (similar to a shebang), to identify modules and load them directly to the filesystem.

Magic comment

The term "magic comment" is used following the example set by PEP 263 - Defining Python Source Code Encodings.

For a module of name foo at version v1.2.3 the format is as follows:

# microbit-module: foo@1.2.3

Rules: