This repo is based on https://github.com/makerbit/microbit-stub. It provides type hints and type checking in your IDE while coding the BBC micro:bit with Python.
I have added support for micro:bit V2.
Detailed description on how to use stub files with Visual Studio Code and Pylint.
In short:
-
Clone this repo to your workspace.
-
Add settings.json to your workspace and make sure it contains:
"python.languageServer": "Pylance", "python.analysis.autoSearchPaths": true, "python.autoComplete.extraPaths": [ "path/to/stub/files" ], "python.linting.enabled": true, "python.linting.pylintEnabled": true
-
You will also need a .pylintrc file in your workspace with the following:
[MASTER] init-hook='import sys;sys.path[1:1] = ["path/to/stub/files",]'
GNU GENERAL PUBLIC LICENSE.