Skip to content

User guide: Python editor

User guide

The micro:bit Python Editor

Supporting students learning text-based coding with the BBC micro:bit

Why learn Python on the micro:bit?

Python is an excellent first text-based language to learn. Its instructions and syntax are based on natural language, making code easy to read, understand and modify.

As well as being widely used in education, it's used in industry, especially in the areas of data science and machine learning. Python is not just used by software developers, but also by people working in fields as diverse as medicine, physics and finance.

Python on the BBC micro:bit brings the benefits of physical computing to students aged 11-14, learning programming fundamentals through text-based coding: immersive, creative experiences for students that help build engagement and knowledge.

Numbered screenshot of the micro:bit Python editor
Try the micro:bit Python Editor

Features for education

Click on the headings below to discover some key features of the micro:bit Python Editor designed to overcome some common barriers, boost creativity and make the most of your coding time in class:

1. Reference

The Reference section makes it easy to discover what Python and the micro:bit can do, like browsing blocks in MakeCode or Scratch.

Easily discovering the potential of the micro:bit hardware and writing software in Python boosts your students' creativity.

2. Drag and drop code snippets

Students can drag working examples of code straight into the editor and test them out straight away. This saves time and helps overcome barriers caused by lack of keyboard skills and the need to remember precise syntax.

screen recording showing drag and drop functionality

3. Code structure highlighting

Blocks of colour show the structure of your students' Python programs, which helps with the design, planning and testing phases of their project. It's easier to understand the flow of a program when you can easily see which lines of code belong in a loop or 'if... then' statement, for example.

We know students new to Python can find indentations confusing, so clear lines help with debugging, making it easy to spot if code is not correctly aligned.

code structure and error highlighting screen recording

4. Error highlighting

Errors are a normal part of coding. Symbols by the line number help you and your students identify bugs and fix them before sending code to a micro:bit. You can hover over the circle in the margin to see an explanation of the error.

code structure and error highlighting screen recording

5. Auto-complete

Fear of a blank screen and not knowing what to type are two of the biggest barriers to starting text-based coding.

So, as you type, the editor makes suggestions which you can pick by clicking or pressing the enter key. This saves time, saves typing errors and saves students having to remember precise syntax.

It's also another way of discovering what Python and the micro:bit can do, for example by seeing more options for built-in images.

screen recording of autocomplete working

6. Simulator

Students can test their code out using the simulator before sending it to a real micro:bit.

This helps them develop, test, debug and evaluate their code and means they can work on projects even when they don't have access to a micro:bit device.

Screen recording of simulator in use

7. Ideas

Don't forget to explore the Ideas tab which contains complete working programs your students can use straight away, then modify to make their own. You'll find an emotion badge, step counter, radio, and sound projects.

Some of the projects listed in the Ideas section of the new editor
Try the micro:bit Python Editor

Overcoming barriers to learning

Click on the headings below to explore how the micro:bit Python Editor is designed to overcome common barriers to engaging and making progress with text-based coding:

Fear of a blank screen

Full project in the Ideas tab (7), working code examples in the Reference (2), and options that pop up as you type (5) mean your students can get coding, experimenting and creating straight away.

Discoverability for creativity

The editor makes language and device features easily discoverable using the Reference section (1) and auto-completion of code (5).

Greater awareness of the features of Python and the micro:bit means students spend less time searching, and more time thinking creatively in solving coding challenges.

Keyboard skills and memory

Code snippets (2) you can drag and drop into code and valid options offered as you type (5) mean students have less to type and remember. This means their code is more likely to run first time, so they can spend more time creating and less time debugging typing errors.

Aid iterative project design

The simulator (6) allows students to test and evaluate code quickly in the editor before transferring to a real micro:bit, speeding up iterative design work.

Understanding program structure

Indentation highlighting (3), lines, and blocks of colour make it easier to visualise and understand the structure and flow of code.

Supporting debugging

Debugging is an essential skill, made easier in the micro:bit Python Editor through error highlighting (4), code structure highlighting (3) to aid fixing indentation errors, and testing in the simulator (6). Error messages from your micro:bit device can also be examined in the serial console.

Making the most of precious time

All of these features are designed to enable students to get more practice doing real programming in the precious classroom time available and empower teachers to spend less time fixing small mistakes and more time teaching core concepts.

Technical requirements

You just need a web browser to load the editor. Once loaded, it will continue to work, even if your internet connection becomes unstable.

The editor will work on any recent Windows, Mac or Chromebook computer.

If you want to send your code direct to your micro:bit, without downloading it as a HEX file first, you'll need to use Microsoft Edge or Google Chrome browsers. Click on 'Send to micro:bit' and follow the instructions on screen.

Saving work

Students can save their work locally, or in shared storage, as HEX project files which can be copied direct to a micro:bit or re-loaded in the editor. Code can also be saved as Python text files which can also be reloaded in the editor, either by dragging and dropping or using the 'Open' button.

You can also use the micro:bit Python Editor in live coding lessons in person, or remotely, using micro:bit classroom. This lets you save a whole class's code as one Word document and also as a file to resume work on the same projects at a later date. It's totally free of charge and no logins or passwords are needed.

Support for localisation

Although Python itself is in English, learning to code in text-based languages is made more accessible when students can read explanations and use a code editor with an interface in their own language.

The micro:bit Python editor's buttons, Reference content and Ideas projects have been translated into several languages including French, Spanish, Chinese, Japanese and Korean.

Click on the cog icon and then select 'Language':

Screenshot of clicking on settings cog icon to change the language

Find out more

You can find more detailed information and videos about how to use the micro:bit Python Editor on our support site.

Read more about the Python Editor

Try it out

Test the editor for yourself right now. Browse the Reference and Ideas sections and see how quickly you and your students get inspired.

This short video will help you get coding in Python in seconds:

Open the micro:bit Python Editor