Python and MicroPython Resources
================================
.. toctree::
:hidden:
tutorial
Introductory |short_port_name| Python Videos:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The series of short videos bellow will help you get started with integrating python scripts into |short_port_name|.
#. Getting Started part 1 |Intro_part_1|
#. Getting Started part 2 |Intro_part_2|
#. Hook Linkcomm into PyCharm |Hook_Linkcomm_into_Pycharm|
#. Getting Python script into LinkComm |Getting_python_script_into_Linkcom|
#. Basic measurement script setup |Basic_measurement_script_setup|
#. Basic task script setup |Basic_task_script_setup|
#. Basic Txformat script setup |Basic_Txformat_script_setup|
Any non-Sutron trademarks captured in these videos remain the property of their respective owners.
Python Tutorials:
~~~~~~~~~~~~~~~~~
- :doc:`tutorial`
- `A Byte of Python, by Swaroop C.H., is an introductory text for
people with no previous programming
experience `__
- `Official Python Documentation `__
- `Official Python
Tutorial `__
- `Differences between MicroPython and
Python `__
- `Google's Python Style
Guide `__
MicroPython Resources:
~~~~~~~~~~~~~~~~~~~~~~
- `Home page `__
- `Discussion Forums `__
- `Source code `__
- `MicroPython Tutorial (using their
PyBoard) `__
- `Library
Documentation `__
- `Original KickStarter for
MicroPython `__
- `Follow on KickStarter to support the ESP8266 (WiFi IoT
board) `__
- `KickStarter for LoPy board (LoRa, WiFi, BLE IoT
board) `__
- `KickStarter for FiPy board (LoRa, WiFi, BLE, LTE, SigFox IoT
board) `__
- `MicroPython Tutorial with the
BBC:MicroBit `__
Python Videos:
~~~~~~~~~~~~~~
- Learn Python in One Video by Derek Banas. Rapid overview of python
syntax and manipulation of strings, lists, tuples, dictionary,
conditionals, loops, functions, user input, string functions, file
I/O, classes, ect.:
.. raw:: html
- Damien George introduces MicroPython and why he created it:
.. raw:: html
- Multi-part Video on Python starting with the very basics:
.. raw:: html
- Learn about Decorators and when to use them:
.. raw:: html
- Creating beautiful python code. Comparing typical programmer approach
with code examples to equivalent python implementation. A talk given
by one of the python developers:
.. raw:: html
- PyCharm Overview:
.. raw:: html
More Python Articles and Links
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- `Python Resources for
Hydrologists `__
- `Fast Fourier Transform for uPy (uses ARM Thumb integer
math) `__
MicroPython Built-In Libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A number of libraries have been written for MicroPython, these are
built-in to a port and can be imported by Python programs. The |short_port_name| port
of MicroPython initially includes all the libraries that could be easily
ported and did not require additional hardware or conflict with the
use of Sutorn hardware. Some of the libraries are bare bones ports, and
most are optional.
- Nice documentation of libraries available for the pyBoard port of
MicroPython: \ http://docs.micropython.org/en/v1.8.3/pyboard/library/index.html
Here's a list of the standard libraries that have been ported to the
|short_port_name|:
- array
- builtins
- cmath
- collections
- gc
- math
- micropython
- struct
- sys
- errno
- \_thread
Here's a list of the optional libraries that have been ported to the |short_port_name|
(which ones we keep is tbd):
- umachine
- pyb
- stm
- binascii
- re
- zlib
- json
- heapq
- hashlib
- time
- struct
- machine
- urandom
- uctypes
- os
Currently not supported:
- select
- lwip
- framebuf
- btree
- axtls
- mbedtls
- timeq
- webrepl
- websocket
- dupterm
- vfs
MicroPython Standard Libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MicroPython takes a minimalistic approach but yet tries to support as
much of Python 3.4/3.5 as possible. To do this any standard Python
libraries which can be written in Python are written in Python. It looks
very impressive, but many of the libraries are just stubs. For instance
if you look at 'poplib' and examine 'poplib.py' the last remark for it
was "poplib: Add dummy module" indicating that the last update only
created a "dummy module" or a stub for where code should go in the
future. It's also possible to embed precompiled Python code into a port
using a concept called "frozen modules". The future usefulness of these
libraries is up to the community.
- This is a link to the library
repository: \ https://github.com/micropython/micropython-lib
MicroPython Cross Compiler and Windows Version.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roberthh has a web page with a pre-built copy of MicroPython built for
Windows, as well as the mpy-cross Cross Compiler that converts .py in to
.mpy. The latest version of mpy-cross is not compatible with the version
of uPy |short_port_name| are currently using, but we can access the history, and
the Oct 11, 2016 version seems to work. MicroPython.exe is based on the
Linux port, and will have differences from our port.
see here: \ https://github.com/robert-hh/Shared-Stuff
Udacity Free Courses
~~~~~~~~~~~~~~~~~~~~
Programming Foundations with Python: (6 weeks, beginner level)
https://www.udacity.com/course/programming-foundations-with-python--ud036
Very beginner level but using Python: (3 Months, beginner level)
https://www.udacity.com/course/intro-to-computer-science--cs101
.. |Basic_measurement_script_setup| raw:: html
.. |Basic_task_script_setup| raw:: html
.. |Basic_Txformat_script_setup| raw:: html
.. |Getting_python_script_into_Linkcom| raw:: html
.. |Hook_Linkcomm_into_Pycharm| raw:: html
.. |Intro_part_1| raw:: html
.. |Intro_part_2| raw:: html
.. |Basic_measurement_script_setup_copy_to_media| image:: ./media/Basic_measurement_script_setup.webm
.. |Basic_task_script_setup_copy_to_media| image:: ./media/Basic_task_script_setup.webm
.. |Basic_Txformat_script_setup_copy_to_media| image:: ./media/Basic_Txformat_script_setup.webm
.. |Getting_python_script_into_Linkcom_copy_to_media| image:: ./media/Getting_python_script_into_Linkcom.webm
.. |Hook_Linkcomm_into_Pycharm_copy_to_media| image:: ./media/Hook_Linkcomm_into_Pycharm.webm
.. |Intro_part_1_copy_to_media| image:: ./media/Intro_part_1.webm
.. |Intro_part_2_copy_to_media| image:: ./media/Intro_part_2.webm