Mu 入门：一个面向初学者的 Python 编辑器
Python

> 
> 相识 Mu —— 一个可以使学生学习 Python 更轻松的开源编辑器。
> 
> 
> 


![](/data/attachment/album/201808/15/124829nvjjnihejp6vhtv5.png)


Mu 是一个给初学者的 Python 编辑器，它旨在使学习体验更加愉快。它使学生​​能够在早期体验成功，这在你学习任何新知识的时候都很重要。


如果你曾试图教年轻人如何编程，你会立即把握到 [Mu](https://codewith.mu) 的重要性。大多数编程工具都是由开发人员为开发人员编写的，不管他们的年龄如何，它们并不适合初学者。然而，Mu 是由老师为学生写的。


### Mu 的起源


Mu 是 [Nicholas Tollervey](https://us.pycon.org/2018/speaker/profile/194/) 的心血结晶（我听过他 5 月份在 PyCon2018 上发言）。Nicholas 是一位受过古典音乐训练的音乐家，在担任音乐老师期间，他在职业生涯早期就开始对 Python 和开发感兴趣。他还写了 [Python in Education](https://www.oreilly.com/programming/free/python-in-education.csp)，这是一本可以从 O'Reilly 下载的免费书。


Nicholas 曾经寻找过一个更简单的 Python 编程界面。他想要一些没有其他编辑器（甚至是 Python 附带的 IDLE3 编辑器 ）复杂性的东西，所以他与 Raspberry Pi 基金会（赞助他的工作）的教育总监 [Carrie Ann Philbin](https://uk.linkedin.com/in/carrie-anne-philbin-a20649b7) 合作开发了 Mu 。


Mu 是一个用 Python 编写的开源程序（在 [GNU GPLv3](https://mu.readthedocs.io/en/latest/license.html) 许可证下）。它最初是为 [Micro:bit](http://microbit.org/) 迷你计算机开发的，但是其他老师的反馈和请求促使他将 Mu 重写为通用的 Python 编辑器。


### 受音乐启发


Nicholas 对 Mu 的启发来自于他教授音乐的方法。他想知道如果我们按照教授音乐的方式教授编程会如何，并立即看出了差别。与编程不同，我们没有音乐训练营，我们也不会书上学习如何演奏乐器，比如说如何演奏长笛。


Nicholas 说，Mu “旨在成为真实的东西”，因为没有人可以在 30 分钟内学习 Python。当他开发 Mu 时，他与老师一起工作，观察编程俱乐部，并观看中学生使用 Python。他发现少即多，保持简单可以改善成品的功能。Nicholas 说，Mu 只有大约 3,000 行代码。


### 使用 Mu


要尝试它，[下载](https://codewith.mu/en/download) Mu 并按照 [Linux、Windows 和 Mac OS](https://codewith.mu/en/howto/install_with_python)的简易安装说明进行操作。如果像我一样，你想[在 Raspberry Pi 上安装](https://codewith.mu/en/howto/install_raspberry_pi)，请在终端中输入以下内容：



```
$ sudo apt-get update
$ sudo apt-get install mu

```

从编程菜单启动 Mu。然后你就可以选择如何使用 Mu。


![](/data/attachment/album/201808/15/124843tby91r6ecbe67lhl.png)


我选择了Python 3，它启动了编写代码的环境。Python shell 直接在下面，它允许你查看代码执行。


![](/data/attachment/album/201808/15/124855ox2oo72695pvqp5o.png)


菜单使用和理解非常简单，这实现了 Mu 的目标 —— 让编写代码对初学者简单。


在 Mu 用户的网站上可找到[教程](https://codewith.mu/en/tutorials/)和其他资源。在网站上，你还可以看到一些帮助开发 Mu 的[志愿者](https://codewith.mu/en/thanks)的名字。如果你想成为其中之一并[为 Mu 的发展做出贡献](https://mu.readthedocs.io/en/latest/contributing.html)，我们非常欢迎您。




---


via: <https://opensource.com/article/18/8/getting-started-mu-python-editor-beginners>


作者：[Don Watkins](https://opensource.com/users/don-watkins) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Mu is a Python editor for beginning programmers, designed to make the learning experience more pleasant. It gives students the ability to experience success early on, which is important anytime you're learning something new.

If you have ever tried to teach young people how to program, you will immediately grasp the importance of [Mu](https://codewith.mu). Most programming tools are written by developers for developers and aren't well-suited for beginning programmers, regardless of their age. Mu, however, was written by a teacher for students.

## Mu's origins

Mu is the brainchild of [Nicholas Tollervey](https://us.pycon.org/2018/speaker/profile/194/) (who I heard speak at PyCon2018 in May). Nicholas is a classically trained musician who became interested in Python and development early in his career while working as a music teacher. He also wrote * Python in Education*, a free book you can download from O'Reilly.


Nicholas was looking for a simpler interface for Python programming. He wanted something without the complexity of other editors—even the IDLE3 editor that comes with Python—so he worked with [Carrie Ann Philbin](https://uk.linkedin.com/in/carrie-anne-philbin-a20649b7), director of education at the Raspberry Pi Foundation (which sponsored his work), to develop Mu.

Mu is an open source application (licensed under [GNU GPLv3](https://mu.readthedocs.io/en/latest/license.html)) written in Python. It was originally developed to work with the [Micro:bit](http://microbit.org/) mini-computer, but feedback and requests from other teachers spurred him to rewrite Mu into a generic Python editor.

## Inspired by music

Nicholas' inspiration for Mu came from his approach to teaching music. He wondered what would happen if we taught programming the way we teach music and immediately saw the disconnect. Unlike with programming, we don't have music boot camps and we don't learn to play an instrument from a book on, say, how to play the flute.

Nicholas says, Mu "aims to be the real thing," because no one can learn Python in 30 minutes. As he developed Mu, he worked with teachers, observed coding clubs, and watched secondary school students as they worked with Python. He found that less is more and keeping things simple improves the finished product's functionality. Mu is only about 3,000 lines of code, Nicholas says.

## Using Mu

To try it out, [download](https://codewith.mu/en/download) Mu and follow the easy installation instructions for Linux, Windows, and Mac OS. If, like me, you want to [install it on Raspberry Pi](https://codewith.mu/en/howto/1.0/install_raspberry_pi), enter the following in the terminal:

```
$ sudo apt-get update
$ sudo apt-get install mu
```


Launch Mu from the Programming menu. Then you'll have a choice about how you will use Mu.

![Select how to run Mu Select how to run Mu](https://opensource.com/sites/default/files/uploads/mu_selectmode.png)

I chose Python 3, which launches an environment to write code; the Python shell is directly below, which allows you to see the code execution.

![Write Python code in Mu Write Python code in Mu](https://opensource.com/sites/default/files/uploads/mu_writecode.png)

The menu is very simple to use and understand, which achieves Mu's purpose—making coding easy for beginning programmers.

[Tutorials](https://codewith.mu/en/tutorials/) and other resources are available on the Mu users' website. On the site, you can also see names of some of the [volunteers](https://codewith.mu/en/thanks) who helped develop Mu. If you would like to become one of them and [contribute to Mu's development](https://mu.readthedocs.io/en/latest/contributing.html), you are most welcome.

## 5 Comments