Welcome to Mu!
Mu is a Python code editor for beginner programmers. This means Mu makes it very easy to create, run and revise your Python programs as you learn to code in Python.
Mu is very simple and easy to understand. Here’s what it looks like:
While there may seem to be lots going on in the picture above, if we break it down into slices you’ll see that Mu is easy to learn.
At the very top of Mu is a title bar (shown in the following picture). This may look different on your computer, but its function is always the same: to display the version of Mu that you’re using (this is useful if you ever need to tell us if you’ve found a problem with Mu) along with the name of the current Python file that you’re editing.
Next comes the button bar:
As you can see, it contains round buttons. If you hover your mouse over a button (without actually clicking it) you’ll see a little tool-tip pop up over the button containing more information about what the button does. Try it!
Most of the buttons remain the same, but some will change depending on what you’re doing at the time.
The buttons are grouped together:
Mode: This button is so important, it goes in its own group. Click it to change Mu’s current mode. Each mode has different capabilities depending on what it is you want to achieve. If you want to know more about modes, there is a tutorial about modes for you to read next.
If files have a name, they are usually auto-saved every 5 seconds.
Code actions: The next group of buttons can change, depending on which mode you’re currently using. They give you interesting ways to interact with the code you have written. In the example above the “Run”, “Debug”, “REPL” and “Plotter” buttons are part of this group. The buttons for each mode are described in the tutorials for each separate mode.
Mu remembers which theme you were last using when you restart the editor.
Underneath the buttons are “tabs” which show you the files you have open and highlight the one you’re currently working on:
Click on the tab to change to the file named in the tab.
To close a file you just click on the cross in the file’s tab. You can also click and drag the tabs from left to right and back again, to re-order them.
If you want to rename a file, double click on its name in the tab and you’ll be asked for the new name.
Underneath the tabs comes the largest and most important part of Mu ~ the text editor:
This displays the code for the currently selected tab. As you change tabs you’ll see that the code in this area changes. If you click on this area and start typing you’ll see your code appear here. As you type code Mu will change the colour of the text to help you read the code. On the left hand side is a column containing the line numbers for your file. These are useful for when Python reports errors (which usually contain line numbers).
Finally, at the bottom is the footer
The footer contains three things:
Let’s create your first Python program with Mu.
print("Hello from Mu!")
Steps 3, 4 and 5 are shown below:
Congratulations! You’ve just written and run your first Python program using Mu. Next, why not learn about modes in Mu?