MakeCode Python is here!

Python is a programming language that was created in the early 1990’s which has become popular in data science applications and in education. Microsoft MakeCode already supports Blocks and the JavaScript programming language, and now we’re happy to also announce support for Python!

Python is available today in MakeCode for Minecraft, and we will be bringing it to our other code editors later this year. Here are a few of the new features we’ve added to make it easy for students to transition from a visual Block-based language to a text-based language like JavaScript or Python:

Language Toggle

Convert your program back and forth between Blocks and either JavaScript or Python.

Language toggle control

Project Language settings

We now add an icon to your recently created projects on the Home Page to indicate whether you were editing your program or completing a tutorial in Blocks, JavaScript, or Python.

Project settings icon

In addition, you can choose to create a JavaScript or Python only project.

Always come back to Blocks

We know that learning a text-based programming language is hard and can be intimidating, so we try as much as possible to allow students to be able to switch back to blocks whenever they get stuck or want to see their code in blocks. If we can’t convert the code to existing blocks, we will show a read-only placeholder of the code that students can still move around as grey blocks.

Python code as grey blocks

Toolbox

We include the familiar Toolbox in both the JavaScript and Python editors to allow students to explore the different code snippets and help them understand what the code does. Students can also drag and drop code snippets from the Toolbox into the code editor window.

Python Toolbox

IntelliSense and auto-complete

The MakeCode text editors are built on the same technology that is used for Visual Studio, our professional line of developer tools. This means we benefit from a lot of the features included in these products. IntelliSense provides intelligent code completion suggestions as you type, so students can see a list of the possible methods or properties they could insert. You can trigger IntelliSense by typing Ctrl+Space or by typing a trigger character such as the “dot” character (“.“) which connects methods and properties to a namespace. Pressing Tab or Enter will insert the selected option.

Intellisense for Python

Error detection

To help students identify errors in their code, a red wavy underline will appear along with an error message when the student hovers over the indicated error with their mouse.

Error tips in the editior

Tooltips

If a student doesn’t understand what a piece of code does, they can hover their mouse over any code snippet and get a pop-up Tooltip description.

Tooltip for parameter

Tutorials and Examples in multiple languages

Code samples and tutorials on our Home Page are available in different language contexts for Blocks, JavaScript and Python. This feature lets tutorial writers create just one tutorial for both JavaScript and Python languages. The multiple language feature detects which context to use and displays any snippets or examples in the selected language.

Multi-language tutorials

Reference and Documentation

We are working to provide code snippets and examples for our reference documentation in all three languages – Blocks, JavaScript and Python.

Code snippets in documents

And, Thanks To…

Big thanks to Michal who came up with the overall 3-language architecture while riding in a taxi through London, and to Daryl who spent many painstaking hours working through the language service and the finer details of implementation!

Also, thank you to all the Educators out there who provided us with super helpful feedback and great suggestions on how to make the transition from Blocks to Text coding as easy as possible for students.


Happy Making and Coding (in Blocks, JavaScript, or Python)!

The MakeCode Team