Stop Press: If you use MobaXTerm then please read about a possible bug.

Stop Press: On March 20 2017 I published another YouTube video, this time looking at a variety of possible workflows for programming the EV3 with EV3 Python. See it on the Workflows pageFor other news please see the news page.

This site, which can be reached at, is intended to help users of the Lego EV3 robot who are already familiar with the basics of programming in Python to begin using the EV3 Python programming language to control their robot.

The Lego Mindstorms EV3 robot is a very popular educational / entertainment robot that is normally programmed using an icon-based programming system that resembles Scratch. Read more about icon-based Lego EV3 programming on my site But the EV3 has a Linux computer at its heart and can therefore be programmed using a number of other programming systems such as Python, C++, Java or EV3 Basic (see my site Running these more advanced programming languages allows you to get your EV3 robot to do things that would not be possible with the standard EV3 programming system, such as make this drawing robot which uses EV3 Python:

This site is not intended to show you how to make programs as complex as the one above, only to help you get started with EV3 programming by working with very short, simple, easy-to-understand programs. But maybe one day you will be able to make your own programs as impressive as the one above.

In addition to empowering you to write programs that can do things that cannot be achieved with the standard icon-based EV3 programmings system, another great reason to learn EV3 Python is that EV3 Python is a textual programming language, the kind professional programmers use. Learning a textual programming language (especially Python) can boost your career prospects enormously, whereas learning to program the EV3 with the standard icon-based system will have much less value professionally.

If you are not sure which programming system you should be using to program the EV3 then follow this link. If you are sure that you want to use Python to program the EV3 then read on...

You're probably curious about what an EV3 Python program looks like. Here is an example which uses a color sensor to help a rover-type vehicle to follow a black line. This is just to give you a glimpse of an EV3 Python script - the full explanation is on THIS PAGE. This program does however include comments (preceded each time by an '#' sign) which are there solely to help you understand the code.

#!/usr/bin/env python3
from ev3dev.ev3 import *

btn = Button() # will use any button to stop script

# Connect EV3 color sensor.
cl = ColorSensor() 

# Put the color sensor into COL-REFLECT mode
# to measure reflected light intensity.

# Attach large motors to ports B and C
mB = LargeMotor('outB')
mC = LargeMotor('outC')

while not btn.any():    # exit loop when any button pressed
    if cl.value()<30:   # weak reflection so over black line
        # medium turn right
    else:   # strong reflection (>=30) so over white surface
        # medium turn left

EV3 Python needs to run on top of the EV3dev operating system. The official site of EV3dev and EV3 Python is and I will refer you to that site for the details of the installation and the documentation of the various EV3 Python functions. The developers of EV3dev and EV3 Python have done a fantastic job making available a stable operating system and robot-related Python commands with the simplest possible syntax. By the way, be aware that the 'official' EV3 Python described on this site should not be confused with an alternate version, Topikachu's 'Python EV3'. If you choose to use the official EV3 Python then you should ignore anything you find online that refers to the Topikachu version, to avoid confusion.

Unlike the developers of EV3dev, I'm not an expert on Linux, EV3Dev or EV3 Python, but I do have intermediate EV3 Python skills and above all I have decades of experience teaching computer science to teens. I think that makes me well qualified to help people who already know the basics of Python and who want to start using EV3 Python to control their Lego EV3 robot. This site is in no way endorsed by Lego Corporation.

I am a Windows man, so this site will be oriented towards users of Windows, but users of other platforms should also find the site useful. This site is designed to be compatible with both types of EV3 robot kit: the home edition and the education edition. This site will only discuss what can be achieved with the standard Lego hardware - there will be no discussion of third party hardware. Having said that, it's good to know that it should be possible to use EV3dev and EV3 Python with third-party sensors and motors and even run EV3 Python on other platforms in addition to the EV3, such as Raspberry Pi with either the BrickPi shield or the PiStorms shield. These 'shields' plug into the Raspberry Pi and act as an interface between the Raspberry Pi and Lego EV3 motors and sensors. This means you can use the extra power of the Pi compared to the EV3 and in the case of PiStorms you also get a nice color screen. See HERE.

Now that you understand what this site is about, the next step is for you to install EV3Dev and EV3 Python.
Subpages (2): News Why EV3 Python?