{ "info": { "author": "ev3dev Python team", "author_email": "python-team@ev3dev.org", "bugtrack_url": null, "classifiers": [], "description": "Python language bindings for ev3dev\n===================================\n\n.. image:: https://travis-ci.org/ev3dev/ev3dev-lang-python.svg?branch=ev3dev-stretch\n :target: https://travis-ci.org/ev3dev/ev3dev-lang-python\n.. image:: https://readthedocs.org/projects/python-ev3dev/badge/?version=ev3dev-stretch\n :target: http://python-ev3dev.readthedocs.org/en/ev3dev-stretch/?badge=ev3dev-stretch\n :alt: Documentation Status\n.. image:: https://badges.gitter.im/ev3dev/chat.svg\n :target: https://gitter.im/ev3dev/chat\n :alt: Chat at https://gitter.im/ev3dev/chat\n\nA Python3 library implementing an interface for ev3dev_ devices,\nletting you control motors, sensors, hardware buttons, LCD\ndisplays and more from Python code.\n\nIf you haven't written code in Python before, you can certainly use this\nlibrary to help you learn the language!\n\nGetting Started\n---------------\n\nThis library runs on ev3dev_. Before continuing, make sure that you have set up\nyour EV3 or other ev3dev device as explained in the\n`ev3dev Getting Started guide`_. Make sure you have an ev3dev-stretch version\ngreater than ``2.2.0``. You can check the kernel version by selecting\n\"About\" in Brickman and scrolling down to the \"kernel version\".\nIf you don't have a compatible version,\n`upgrade the kernel before continuing`_.\n\nUsage\n-----\n\nTo start out, you'll need a way to work with Python. We recommend the\n`ev3dev Visual Studio Code extension`_. If you're interested in using that,\ncheck out our `Python + VSCode introduction tutorial`_ and then come back\nonce you have that set up.\n\nOtherwise, you can can work with files `via an SSH connection`_ with an editor\nsuch as `nano`_, use the Python interactive REPL (type ``python3``), or roll\nyour own solution. If you don't know how to do that, you are probably\nbetter off choosing the recommended option above.\n\nThe template for a Python script\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nEvery Python program should have a few basic parts. Use this template\nto get started:\n\n.. code-block:: python\n\n #!/usr/bin/env python3\n from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_B, SpeedPercent, MoveTank\n from ev3dev2.sensor import INPUT_1\n from ev3dev2.sensor.lego import TouchSensor\n from ev3dev2.led import Leds\n\n # TODO: Add code here\n\nThe first line should be included in every Python program you write\nfor ev3dev. It allows you to run this program from Brickman, the graphical\nmenu that you see on the device screen. The other lines are import statements\nwhich give you access to the library functionality. You will need to add\nadditional classes to the import list if you want to use other types of devices\nor additional utilities.\n\nYou should use the ``.py`` extension for your file, e.g. ``my-file.py``.\n\nIf you encounter an error such as\n``/usr/bin/env: 'python3\\r': No such file or directory``,\nyou must switch your editor's \"line endings\" setting for the file from\n\"CRLF\" to just \"LF\". This is usually in the status bar at the bottom.\nFor help, see `our FAQ page`_.\n\nImportant: Make your script executable (non-Visual Studio Code only)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo be able to run your Python file, **your program must be executable**. If\nyou are using the `ev3dev Visual Studio Code extension`_, you can skip this\nstep, as it will be automatically performed when you download your code to the\nbrick.\n\n**To mark a program as executable from the command line (often an SSH session),\nrun** ``chmod +x my-file.py``.\n\nYou can now run ``my-file.py`` via the Brickman File Browser or you can run it\nfrom the command line by preceding the file name with ``./``: ``./my-file.py``\n\nControlling the LEDs with a touch sensor\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis code will turn the LEDs red whenever the touch sensor is pressed, and\nback to green when it's released. Plug a touch sensor into any sensor port\nbefore trying this out.\n\n.. code-block:: python\n\n ts = TouchSensor()\n leds = Leds()\n\n print(\"Press the touch sensor to change the LED color!\")\n\n while True:\n if ts.is_pressed:\n leds.set_color(\"LEFT\", \"GREEN\")\n leds.set_color(\"RIGHT\", \"GREEN\")\n else:\n leds.set_color(\"LEFT\", \"RED\")\n leds.set_color(\"RIGHT\", \"RED\")\n\nIf you'd like to use a sensor on a specific port, specify the port like this:\n\n.. code-block:: python\n\n ts = TouchSensor(INPUT_1)\n\nRunning a single motor\n~~~~~~~~~~~~~~~~~~~~~~\n\nThis will run a LEGO Large Motor at 75% of maximum speed for 5 rotations.\n\n.. code-block:: python\n\n m = LargeMotor(OUTPUT_A)\n m.on_for_rotations(SpeedPercent(75), 5)\n\nYou can also run a motor for a number of degrees, an amount of time, or simply\nstart it and let it run until you tell it to stop. Additionally, other units\nare also available. See the following pages for more information:\n\n- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#ev3dev.motor.Motor.on_for_degrees\n- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#units\n\nDriving with two motors\n~~~~~~~~~~~~~~~~~~~~~~~\n\nThe simplest drive control style is with the `MoveTank` class:\n\n.. code-block:: python\n\n tank_drive = MoveTank(OUTPUT_A, OUTPUT_B)\n\n # drive in a turn for 5 rotations of the outer motor\n # the first two parameters can be unit classes or percentages.\n tank_drive.on_for_rotations(SpeedPercent(50), SpeedPercent(75), 10)\n\n # drive in a different turn for 3 seconds\n tank_drive.on_for_seconds(SpeedPercent(60), SpeedPercent(30), 3)\n\nThere are also `MoveSteering` and `MoveJoystick` classes which provide\ndifferent styles of control. See the following pages for more information:\n\n- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#multiple-motor-groups\n- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#units\n\nUsing text-to-speech\n~~~~~~~~~~~~~~~~~~~~\n\nIf you want to make your robot speak, you can use the ``Sound.speak`` method:\n\n.. code-block:: python\n\n from ev3dev2.sound import Sound\n\n sound = Sound()\n sound.speak('Welcome to the E V 3 dev project!')\n\nMore Demo Code\n~~~~~~~~~~~~~~\n\nThere are several demo programs that you can run to get acquainted with\nthis language binding. The programs are available\n`at this GitHub site `_.\n\nYou can also copy and run the programs in the `utils` directory to\nunderstand some of the code constructs to use the EV3 motors, sensors,\nLCD console, buttons, sound, and LEDs.\n\nWe also highly recommend `ev3python.com`_ where one of our community\nmembers, @ndward, has put together a great website with detailed guides\non using this library which are targeted at beginners. If you are just\ngetting started with programming, we highly recommend that you check\nit out at `ev3python.com`_!\n\nUsing Micropython\n-----------------\n\nNormal Python too slow? Review `Micropython`_ to see if it supports the\nfeatures your project needs.\n\nLibrary Documentation\n---------------------\n\nClass documentation for this library can be found on\n`our Read the Docs page`_. You can always go there to get\ninformation on how you can use this library's functionality.\n\n\nFrequently-Asked Questions\n--------------------------\n\nExperiencing an odd error or unsure of how to do something that seems\nsimple? Check our our `FAQ`_ to see if there's an existing answer.\n\n\n.. _ev3dev: http://ev3dev.org\n.. _ev3dev.org: ev3dev_\n.. _Getting Started: ev3dev-getting-started_\n.. _ev3dev Getting Started guide: ev3dev-getting-started_\n.. _ev3dev-getting-started: http://www.ev3dev.org/docs/getting-started/\n.. _upgrade the kernel before continuing: http://www.ev3dev.org/docs/tutorials/upgrading-ev3dev/\n.. _detailed instructions for USB connections: ev3dev-usb-internet_\n.. _via an SSH connection: http://www.ev3dev.org/docs/tutorials/connecting-to-ev3dev-with-ssh/\n.. _ev3dev-usb-internet: http://www.ev3dev.org/docs/tutorials/connecting-to-the-internet-via-usb/\n.. _our Read the Docs page: http://python-ev3dev.readthedocs.org/en/ev3dev-stretch/\n.. _ev3python.com: http://ev3python.com/\n.. _FAQ: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/faq.html\n.. _our FAQ page: FAQ_\n.. _our Issues tracker: https://github.com/ev3dev/ev3dev-lang-python/issues\n.. _EXPLOR3R: demo-robot_\n.. _demo-robot: http://robotsquare.com/2015/10/06/explor3r-building-instructions/\n.. _robot-square: http://robotsquare.com/\n.. _Python 2.x: python2_\n.. _python2: https://docs.python.org/2/\n.. _Python 3.x: python3_\n.. _python3: https://docs.python.org/3/\n.. _package repository: pypi_\n.. _pypi: https://pypi.python.org/pypi\n.. _latest version of this package: pypi-python-ev3dev_\n.. _pypi-python-ev3dev: https://pypi.python.org/pypi/python-ev3dev2\n.. _ev3dev Visual Studio Code extension: https://github.com/ev3dev/vscode-ev3dev-browser\n.. _Python + VSCode introduction tutorial: https://github.com/ev3dev/vscode-hello-python\n.. _nano: http://www.ev3dev.org/docs/tutorials/nano-cheat-sheet/\n.. _Micropython: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/micropython.html", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ev3dev/ev3dev-lang-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-ev3dev2", "package_url": "https://pypi.org/project/python-ev3dev2/", "platform": "", "project_url": "https://pypi.org/project/python-ev3dev2/", "project_urls": { "Homepage": "https://github.com/ev3dev/ev3dev-lang-python" }, "release_url": "https://pypi.org/project/python-ev3dev2/2.0.0b5/", "requires_dist": null, "requires_python": "", "summary": "v2.x Python language bindings for ev3dev", "version": "2.0.0b5" }, "last_serial": 5695507, "releases": { "2.0.0b1": [ { "comment_text": "", "digests": { "md5": "522e1a04aa98f9c24e8868cf92330b42", "sha256": "38c098b33cc60813a4e023dd84d43faeff7e99ce2673043548d696cfbeee9423" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b1.tar.gz", "has_sig": false, "md5_digest": "522e1a04aa98f9c24e8868cf92330b42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58015, "upload_time": "2018-08-01T04:33:28", "url": "https://files.pythonhosted.org/packages/83/30/304f8848efe66b2da1b317aec7b2f442936efef0f548d66183eff147f917/python-ev3dev2-2.0.0b1.tar.gz" } ], "2.0.0b2": [ { "comment_text": "", "digests": { "md5": "b3447e3d1a569bcbdff4706f8b23f68b", "sha256": "36b3884b26225444065ba071de03a7ed5b1d458f4952205ffaac1f26f77ba870" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b2.tar.gz", "has_sig": false, "md5_digest": "b3447e3d1a569bcbdff4706f8b23f68b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58112, "upload_time": "2018-09-24T17:42:33", "url": "https://files.pythonhosted.org/packages/88/a9/57ba742253e489366956056d37353d4c24132336a010097cd50f98eba706/python-ev3dev2-2.0.0b2.tar.gz" } ], "2.0.0b3": [ { "comment_text": "", "digests": { "md5": "890b03a713065a4fd595bb3acacbc0c9", "sha256": "167482d4a6a5e05e19591c90bbb7360e96d8866cf39b8ed0436cf37408a2ce76" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b3.tar.gz", "has_sig": false, "md5_digest": "890b03a713065a4fd595bb3acacbc0c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64351, "upload_time": "2019-02-03T04:21:58", "url": "https://files.pythonhosted.org/packages/dd/af/b22f4f4b4e1cb98a1330f8ee9765d987fe571705e7cee4f4e256eeb3f96d/python-ev3dev2-2.0.0b3.tar.gz" } ], "2.0.0b4": [ { "comment_text": "", "digests": { "md5": "e22be368fc99bee35fc807955f1636a0", "sha256": "b4be7e6a3b2c8c4fee07ef0a753e2710bbd774a16cbf9239eb527cf775195d31" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b4.tar.gz", "has_sig": false, "md5_digest": "e22be368fc99bee35fc807955f1636a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68513, "upload_time": "2019-08-18T18:54:39", "url": "https://files.pythonhosted.org/packages/8d/3e/6352906a7073d822447ef7c57ba381629c63497e1ae5cd80799b57a30932/python-ev3dev2-2.0.0b4.tar.gz" } ], "2.0.0b5": [ { "comment_text": "", "digests": { "md5": "c9dcc8cc2f6e124a306472508d721d47", "sha256": "00304e0c8d7246da97424c7864eebf59da929f3b64afa0e17fcfe2a9348b2250" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b5.tar.gz", "has_sig": false, "md5_digest": "c9dcc8cc2f6e124a306472508d721d47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68518, "upload_time": "2019-08-18T18:57:15", "url": "https://files.pythonhosted.org/packages/1c/83/3752b29b9309a81b25bd34859b2f96f6254bcf5f57d5d1b7954d5c5339b9/python-ev3dev2-2.0.0b5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c9dcc8cc2f6e124a306472508d721d47", "sha256": "00304e0c8d7246da97424c7864eebf59da929f3b64afa0e17fcfe2a9348b2250" }, "downloads": -1, "filename": "python-ev3dev2-2.0.0b5.tar.gz", "has_sig": false, "md5_digest": "c9dcc8cc2f6e124a306472508d721d47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68518, "upload_time": "2019-08-18T18:57:15", "url": "https://files.pythonhosted.org/packages/1c/83/3752b29b9309a81b25bd34859b2f96f6254bcf5f57d5d1b7954d5c5339b9/python-ev3dev2-2.0.0b5.tar.gz" } ] }