Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 2.34 KB

filesystem.md

File metadata and controls

47 lines (36 loc) · 2.34 KB

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: [email protected]

Rules: