使用 EduBlocks 轻松学习 Python 编程
Python Scratch EduBlocks

> 
> EduBlocks 提供了 Scratch 式的图形界面来编写 Python 3 代码。
> 
> 
> 


![](/data/attachment/album/201808/15/222348bxwz02l8w40h5x4r.png)


如果你正在寻找一种方法将你的学生（或你自己）从使用 [Scratch](https://scratch.mit.edu/) 编程转移到学习 [Python](https://www.python.org/)，我建议你了解一下 [EduBlocks](https://edublocks.org/)。它为 Python 3 编程带来了熟悉的拖放式图形用户界面（GUI）。


从 Scratch 过渡到 Python 的一个障碍是缺少拖放式 GUI，而正是这种拖放式 GUI 使得 Scratch 成为 K-12 学校的首选程序。EduBlocks 的拖放版的 Python 3 改变了这种范式。它的目的是“帮助教师在较早的时候向儿童介绍基于文本的编程语言，如 Python。”


EduBlocks 的硬件要求非常适中 —— 一个树莓派和一条互联网连接 —— 应该可以在许多教室中使用。


EduBlocks 是由来自英国的 14 岁 Python 开发人员 Joshua Lowe 开发的。我看到 Joshua 在 2018 年 5 月的 [PyCon 2018](https://us.pycon.org/2018/about/) 上展示了他的项目。


### 入门


安装 EduBlocks 很容易。该网站提供了清晰的安装说明，你可以在项目的 [GitHub](https://github.com/AllAboutCode/EduBlocks) 仓库中找到详细的截图。


使用以下命令在 Raspberry Pi 命令行安装 EduBlocks：



```
curl -sSL get.edublocks.org | bash

```

### 在 EduBlocks 中编程


安装完成后，从桌面快捷方式或 Raspberry Pi 上的“编程”菜单启动 EduBlocks。


![](/data/attachment/album/201808/15/222120tmzg08g2cmvejacg.png)


启动程序后，你可以使用 EduBlocks 的拖放界面开始创建 Python 3 代码。它的菜单有清晰的标签。你可以通过单击 **Samples** 菜单按钮使用示例代码。你还可以通过单击 **Theme** 为你的编程界面选择不同的配色方案。使用 **Save** 菜单，你可以保存你的作品，然后 **Download** 你的 Python 代码。单击 **Run** 来执行并测试你的代码。


你可以通过单击最右侧的 **Blockly** 按钮来查看代码。它让你在 ”Blockly” 界面和普通的 Python 代码视图之间切换（正如你在任何其他 Python 编辑器中看到的那样）。


![](/data/attachment/album/201808/15/222128y7s1kes2vos70zn1.png)


EduBlocks 附带了一系列代码库，包括 [EduPython](https://edupython.tuxfamily.org/)、[Minecraft](https://minecraft.net/en-us/edition/pi/)、[Sonic Pi](https://sonic-pi.net/)、[GPIO Zero](https://gpiozero.readthedocs.io/en/stable/) 和 [Sense Hat](https://www.raspberrypi.org/products/sense-hat/)。


### 学习和支持


该项目维护了一个[学习门户网站](https://edublocks.org/learn.html)，其中包含教程和其他资源，可以轻松地 [hack](https://edublocks.org/resources/1.pdf) 树莓派版本的 Minecraft，编写 GPIOZero 和 Sonic Pi，并使用 Micro:bit 代码编辑器控制 LED。可以在 Twitter [@edu\_blocks](https://twitter.com/edu_blocks?lang=en) 和 [@all*about*code](https://twitter.com/all_about_code) 以及 [email](mailto:support@edublocks.org) 提供对 EduBlocks 的支持。


为了更深入的了解，你可以在 [GitHub](https://github.com/allaboutcode/edublocks) 上访问 EduBlocks 的源代码。该程序在 GNU Affero Public License v3.0 下[许可](https://github.com/AllAboutCode/EduBlocks/blob/tarball-install/LICENSE)。EduBlocks 的创建者（项目负责人 [Joshua Lowe](https://github.com/JoshuaLowe1002) 和开发人员 [Chris Dell](https://twitter.com/cjdell?lang=en) 和 [Les Pounder](https://twitter.com/biglesp?lang=en)）希望它成为一个社区项目，并邀请人们提出问题，提供反馈，以及提交 pull request 以向项目添加功能或修复。




---


via: <https://opensource.com/article/18/8/edublocks>


作者：[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
If you are you looking for a way to move your students (or yourself) from programming in [Scratch](https://scratch.mit.edu/) to learning [Python](https://www.python.org/), I recommend you look into [EduBlocks](https://edublocks.org/). It brings a familiar drag-and-drop graphical user interface (GUI) to Python 3 programming.

One of the barriers when transitioning from Scratch to Python is the absence of the drag-and-drop GUI that has made Scratch the go-to application in K-12 schools. EduBlocks' drag-and-drop version of Python 3 changes that paradigm. It aims to "help teachers to introduce text-based programming languages, like Python, to children at an earlier age."

The hardware requirements for EduBlocks are quite modest—a Raspberry Pi and an internet connection—and should be available in many classrooms.

EduBlocks was developed by Joshua Lowe, a 14-year-old Python developer from the United Kingdom. I saw Joshua demonstrate his project at [PyCon 2018](https://us.pycon.org/2018/about/) in May 2018.

## Getting started

It's easy to install EduBlocks. The website provides clear installation instructions, and you can find detailed screenshots in the project's [GitHub](https://github.com/AllAboutCode/EduBlocks) repository.

Install EduBlocks from the Raspberry Pi command line by issuing the following command:

`curl -sSL get.edublocks.org | bash`



![Installing EduBlocks through the command line Installing EduBlocks through the command line](https://opensource.com/sites/default/files/uploads/edublocks_installation.png)

## Programming EduBlocks

Once the installation is complete, launch EduBlocks from either the desktop shortcut or the Programming menu on the Raspberry Pi.

![EduBlocks Programming menu EduBlocks Programming menu](https://opensource.com/sites/default/files/uploads/edublocks_programming-menu.png)

Once you launch the application, you can start creating Python 3 code with EduBlocks' drag-and-drop interface. Its menus are clearly labeled. You can start with sample code by clicking the **Samples** menu button. You can also choose a different color scheme for your programming palette by clicking **Theme**. With the **Save** menu, you can save your code as you work, then **Download** your Python code. Click **Run** to execute and test your code.

You can see your code by clicking the **Blockly** button at the far right. It allows you to toggle between the "Blockly" interface and the normal Python code view (as you would see in any other Python editor).

![EduBlocks Blockly toggle EduBlocks Blockly toggle](https://opensource.com/sites/default/files/uploads/edublocks_blockly.png)

EduBlocks comes with a range of code libraries, including [EduPython](https://edupython.tuxfamily.org/), [Minecraft](https://minecraft.net/en-us/edition/pi/), [Sonic Pi](https://sonic-pi.net/), [GPIO Zero](https://gpiozero.readthedocs.io/en/stable/), and [Sense Hat](https://www.raspberrypi.org/products/sense-hat/).

## Learning and support

The project maintains a [learning portal](https://edublocks.org/learn.html) with tutorials and other resources for easily [hacking](https://edublocks.org/resources/1.pdf) the version of Minecraft that comes with Raspberry Pi, programming the GPIOZero and Sonic Pi, and controlling LEDs with the Micro:bit code editor. Support for EduBlocks is available on Twitter [@edu_blocks](https://twitter.com/edu_blocks?lang=en) and [@all_about_code](https://twitter.com/all_about_code) and through [email](mailto:support@edublocks.org).

For a deeper dive, you can access EduBlocks' source code on [GitHub](https://github.com/allaboutcode/edublocks); the application is [licensed](https://github.com/AllAboutCode/EduBlocks/blob/tarball-install/LICENSE) under GNU Affero General Public License v3.0. EduBlocks' creators (project lead [Joshua Lowe](https://github.com/JoshuaLowe1002) and fellow developers [Chris Dell](https://twitter.com/cjdell?lang=en) and [Les Pounder](https://twitter.com/biglesp?lang=en)) want it to be a community project and invite people to open issues, provide feedback, and submit pull requests to add features or fixes to the project.

## 3 Comments