This page is devoted to the __Python__ programming language, including references to tutorials and particular, use of Python in programming robot control systems.

See also: [CircuitPython] and [MicroPython] and [Upgrading Python|UpgradingPython]


!! How to Have Pip3 Install a Module to a Specific Python Version

'nuff said (in the title):
{{{
python3.8 -m pip install foo
}}}


!! Libraries

* __[gpiozero|https://gpiozero.readthedocs.io/en/v1.1.0/index.html#]__, a simple interface to everyday GPIO components used with Raspberry Pi. Installed on Raspbian by default; to install on other OS use:  {{{pip3 install gpiozero}}}
* __[igraph|https://igraph.org/]__ is a collection of network analysis tools with the emphasis on efficiency, portability and ease of use
** [python-igraph|https://github.com/igraph/python-igraph]
** [iGraph Getting Started|https://igraph.org/python/]
* __[NetworkX|https://github.com/networkx/networkx]__ is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. Also see [networkx|http://networkx.github.io/] on github.
* Support for various Pimoroni Breakout Garden boards as [MicroPython modules|https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/modules]


!! Multi-Threading and Multi-Processing in Python

* [Python - Multithreaded Programming |https://www.tutorialspoint.com/python/python_multithreading.htm] (TutorialsPoint)
* [Threading — Thread-based parallelism |https://docs.python.org/3/library/threading.html] (Python documentation)
* [An Intro to Threading in Python|https://realpython.com/intro-to-python-threading/] (Real Python)
* [How can I use threading in Python?|https://stackoverflow.com/questions/2846653/how-to-use-threading-in-python] on StackOverflow
* [Parallelism in One Line|https://chriskiehl.com/article/parallelism-in-one-line] (multiprocessing in Python, how to avoid boilerplate producer-consumer-queueing code by injecting parallelism into the code using Map, a functional programming concept)
* [Multithreading vs Multiprocessing in Python |https://blog.usejournal.com/multithreading-vs-multiprocessing-in-python-c7dc88b50b5b] on the Noteworthy blog
* [PyRobot|https://pyrobot.org/], an Open Source Robotics Research Platform


!! Links

* [Python|https://www.python.org/] home page
* [Python Module Index|https://docs.python.org/3/py-modindex.html]
* [Multi-threading vs multi-processing|https://medium.com/contentsquare-engineering-blog/multithreading-vs-multiprocessing-in-python-ece023ad55a]
* [asyncio implementation on MicroPython|https://docs.micropython.org/en/latest/library/uasyncio.html] (uasyncio)
* [Module Support Matrix - Which Modules Are Available on Which Boards|https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html?filter=i2cperipheral] (by customising the URL you can change the highlighting)
* [Pybotics|https://pypi.org/project/pybotics/], The Python Toolbox for Robotics
* [Robot Framework|https://robotframework.org/], a generic open source automation framework.
      It can be used for test automation and robotic process automation (RPA).
* [Python 101: Redirecting stdout|https://www.blog.pythonlibrary.org/2016/06/16/python-101-redirecting-stdout/]


!! Notes

Below are some __rough notes__. This needs to be edited into proper wiki text and links.
{{{
    Arduino-Powered Robot Solves a Maze Using Subsumption Architecture in C
    http://www.codingnaked.com/post/arduino-powered-robot-solves-a-maze-using-subsumption-architecture-in-c/
    check out: http://www.soerenwalls.com/ who built the robot and wrote the above article

    On Simple Reactive Neural Networks for Behaviour-Based Reinforcement Learning by Ameya Pore and Gerardo Aragon-Camarasa (Python)
    https://github.com/cvas-ug/simple-reactive-nn

    A subsumption-architecture based robot built using the lejos ev3 API. (Java)
    https://github.com/GitPaulo/lego-robot-A1

    Robot Subsumption Controller (alexander-svendsen/ev3-python on github)
    https://github.com/alexander-svendsen/ev3-python

    Lab 7: Subsumption architecture, Due April 16
    https://www.cs.swarthmore.edu/~meeden/cs63/s15/subsumption.html

    Playful: Reactive Programming for Orchestrating Robotic Behavior
    https://www.researchgate.net/publication/325077049_Playful_Reactive_Programming_for_Orchestrating_Robotic_Behavior

  source:

    Lisa Meeden, Neil R. Grabois Professor in Natural Sciences and Engineering and Department Chair
    Swarthmore College, PA
    https://www.cs.swarthmore.edu/~meeden/

      A Developmental Robotics Manifest (Blank, Marshall, Meeden)
      https://www.cs.swarthmore.edu/~meeden/papers/Manifesto2017.pdf

      Towards Planning: Incremental Investigations into Adaptive Robot Control
      Lisa A. Meeden, doctoral thesis
      https://www.cs.swarthmore.edu/~meeden/papers/meeden.thesis.pdf

      Emergent Control and Planning in an Autonomous Vehicle
      Appeared in Proceedings of the Fifteenth Annual Conference of the Cognitive Science Society
      Lisa Meeden and Gary McGraw and Douglas Blank
      https://www.cs.swarthmore.edu/~meeden/papers/meeden.cogsci93.pdf

  which references:
    https://www.cs.swarthmore.edu/~meeden/cs63/s15/pyrobot.php

  which references:
    CS63 Artificial Intelligence Spring 2015
    https://www.cs.swarthmore.edu/~meeden/cs63/s15/index.php

  which references online book:
    Artificial Intelligence: A Modern Approach
    http://aima.cs.berkeley.edu/  (online ToC of book, with related resources)
    https://www.pearsonhighered.com/assets/preface/0/1/3/6/0136042597.pdf (ToC)
    https://www.cin.ufpe.br/~tfl2/artificial-intelligence-modern-approach.9780131038059.25368.pdf (1995 edition, scanned full text)
    p.411 subsumption architecture, also discussed in Chapter 25

      online code repository:
      http://aima.cs.berkeley.edu/code.html

      AIMA Python implementations (with an index of algorithms on that page)
      https://github.com/aimacode/aima-python
}}}
    
----

[{Tag Python}]