Start Here!

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:

The first bug

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.

That’s it!

The Mu title bar

Next comes the button bar:

The Mu 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:

Underneath the buttons are “tabs” which show you the files you have open and highlight the one you’re currently working on:

The tabs in Mu

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:

The text editor in Mu

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 in Mu

The footer contains three things:

Hello From Mu!

Let’s create your first Python program with Mu.

  1. Make sure Mu is in Python 3 mode (check the footer!). If it isn’t click on the “Mode” button and double click “Python 3” mode.
  2. Click the “New” button, then before typing anything, click the “Save” button and give your file a name (for example “hello.py”).
  3. Type the following Python code into the text area:
    print("Hello from Mu!")
    
  4. Click the “Run” button and the output of your program will be displayed in a new “output” area between the text editor and the footer.
  5. Click the “Stop” button to return to editing your code.

Steps 3, 4 and 5 are shown below:

Hello from Mu!

Congratulations! You’ve just written and run your first Python program using Mu. Next, why not learn about modes in Mu?