Skip to main content
Python language bindings for ev3dev
===================================

This is a python library implementing unified interface for ev3dev_ devices.
The source code is hosted at https://github.com/ddemidov/ev3dev-lang-python.

.. _ev3dev: http://ev3dev.org

Installation
------------

* Prerequisites:

.. code-block:: bash

apt-get install libboost-python1.55.0 python-setuptools python-pil

These should be enough to install and use the library on your ev3. If you want
to install it on your main computer (for example, to let your IDE of choice
know about the library), or compile the library from source, you will also need
to install `libboost-python1.55-dev`.

* Now, the actual module installation:

.. code-block:: bash

easy_install -U python-ev3dev

Same command will upgrade already installed package to the latest available
version.

Usage
-----

Take a look at the provided demos_. The autogenerated reference
documentation is hosted at http://ddemidov.github.io/ev3dev-lang-python.

.. _demos: https://github.com/ddemidov/ev3dev-lang-python/tree/master/demo

Here is a simple example of running a large EV3 motor connected to output port
`A` for three seconds:

.. code-block:: python

>>> import ev3dev
>>> m = ev3dev.large_motor('outA')
>>> m.connected
True
>>> m.run_timed(time_sp=3000, duty_cycle_sp=75)

Remote operation
^^^^^^^^^^^^^^^^

.. highlight:: bash

There are a couple of options for running python code remotely on the EV3
(aside from obvious choice of doing everything in ssh session).

First, you can install `IPython Notebook`_ with:

.. code-block:: bash

apt-get install ipython-notebook

and `access the notebook server`_ from your main computer. There is a `nice
post`_ by Laurens Valk showing this in action. Unfortunately, the IPython
process seems to be rather heavy for the limited EV3 resources, and the
experience tends to deteriorate with time.

The second option is using RPyC_ (Remote Python Call) library. It may be
installed with:

.. code-block:: bash

pip install rpyc


You need to install it both on the EV3 and on the remote host.
After that, once you launch RPyC server with `rpyc_classic.py` command on the
EV3, you can connect to the server from your main computer:

.. code-block:: python

>>> import rpyc
>>> c = rpyc.classic.connect("192.168.10.42")

The parameter to `connect()` function is the host name or the ip address of the
EV3. After the connection is made, you can import the `ev3dev` module
remotely:

.. code-block:: python

>>> ev3dev = c.modules.ev3dev
>>> m = ev3dev.large_motor('outA')
>>> m.connected
True
>>> m.run_timed(time_sp=3000, duty_cycle_sp=75)

Note that the code is the same as in the example above once you connect to
remote RPyC server, although its run from a different machine. This may be used
either for interactive developing, or to run resource-heavy programs.

.. _IPython Notebook: http://ipython.org
.. _access the notebook server: https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh
.. _nice post: http://robotsquare.com/2014/06/12/linux-ev3/
.. _RPyC: https://rpyc.readthedocs.org/en/latest/

Metadata

Release files for python-ev3dev 0.2.1.post23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-ev3dev 0.2.1.post23
File Size Uploaded
python-ev3dev-0.2.1.post23.tar.gz 37.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for python-ev3dev 0.2.1.post23
File
python_ev3dev-0.2.1.post23-py3.4-linux-armv6l.egg Legacy Egg format - - Details
python_ev3dev-0.2.1.post23-py3.4-linux-armv5tejl.egg Legacy Egg format - - Details
python_ev3dev-0.2.1.post23-py2.7-linux-armv6l.egg Legacy Egg format - - Details
python_ev3dev-0.2.1.post23-py2.7-linux-armv5tejl.egg Legacy Egg format - - Details

Total release size: 6.0 MB

Release files / python-ev3dev-0.2.1.post23.tar.gz

Download URL python-ev3dev-0.2.1.post23.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
66f278093fa40f1b737b312342bcd1c769192987ec259811f4b213652aef54c5
BLAKE2b-256 checksum
How to use checksums
fcdd792fd4989ec52e15675564aa4c691e48f0f387f3a764fdf4b8edc9d51ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_ev3dev-0.2.1.post23-py3.4-linux-armv6l.egg

Download URL python_ev3dev-0.2.1.post23-py3.4-linux-armv6l.egg
Size 1.4 MB
Tags Egg
SHA-256 checksum
How to use checksums
1d5c0e14153e76da42d5c74cf95bfec9d881b662b487b37c0ed3f49c67eb5a96
BLAKE2b-256 checksum
How to use checksums
d2aad59b3741e9bb0e520b0ec4733483b82177b7a3fd01b110a282e67ea3dfaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_ev3dev-0.2.1.post23-py3.4-linux-armv5tejl.egg

Download URL python_ev3dev-0.2.1.post23-py3.4-linux-armv5tejl.egg
Size 1.5 MB
Tags Egg
SHA-256 checksum
How to use checksums
12b57348004f49e0120d9aaeebbc651931b29d36db005c2e0fd431bbc2c16fd0
BLAKE2b-256 checksum
How to use checksums
3e0ab8ad3a0d8dcab0e93f96e0b0c493e3a5674206153f5520691336272d9863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_ev3dev-0.2.1.post23-py2.7-linux-armv6l.egg

Download URL python_ev3dev-0.2.1.post23-py2.7-linux-armv6l.egg
Size 1.5 MB
Tags Egg
SHA-256 checksum
How to use checksums
a03df00790dfc95f2a8a998054e43a2386c08e643ba4deef773f49bd929ec0a5
BLAKE2b-256 checksum
How to use checksums
bda85bd4096a121420f49c239f4558e22d7b46bb22a456d2fa1c10f3c31d3819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_ev3dev-0.2.1.post23-py2.7-linux-armv5tejl.egg

Download URL python_ev3dev-0.2.1.post23-py2.7-linux-armv5tejl.egg
Size 1.5 MB
Tags Egg
SHA-256 checksum
How to use checksums
6045f4f7d2a11268032b9d7eb9fb9165752d097de0157208fb51edec263d6f92
BLAKE2b-256 checksum
How to use checksums
04534e4fcb6dda8dae7891291ce4ad0102547895d7181001411cb7173dc1e47d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.2.0

1 release file

1.0.0

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

5 release files

0.2.2

5 release files

This release

0.2.1.post23 This release

5 release files

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page