Stop Press: June 2021. This site gets many thousands of visits every month but I don't know why. This site is about an obsolete version of ev3dev Python, version 1. You should be using version 2, which came out years ago and for which I have made a dedicated site (see next note). This version 1 site is a Google Classic site, and Google, in its wisdom, will be blocking access to all Google Classic sites from September 1 2021. Since this site is obsolete, I will not be migrating it to the new Google Sites format, though I will be migrating the version 2 site.

Stop Press: EV3dev Python v2 is out! It is so superior to version 1 that a new website has been created for the new version. Read about the improvements and how to modify your version 1 scripts to take advantage of the new features HERE. Be reassured also that scripts written in version 1 will continue to work with the latest version. The new site dedicated to version 2 can be accessed at and this site dedicated to version 1 can be accessed with This site is now obsolescent and probably will be rarely updated from October 2018 onwards so head over to and migrate to version 2 NOW!

Stop Press: Since May 2018 a great new way of writing and running EV3 Python programs has become available! The new workflow has many advantages over all previous workflows. Click HERE to learn about the new workflow which is based on the free code editor Microsoft Visual Studio Code. VS Code is compatible with Windows, Mac OS and Linux. I will update this site to make it fully compatible with the VS Code workflow over the coming weeks. For 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 EV3dev Python have done a fantastic job making available a stable operating system and robot-related Python commands with the simplest possible syntax.

Unlike some of the developers of EV3dev, I'm not a professional coder, but I do have decades of experience teaching computer science to teens, including Python and EV3. I therefore feel 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?