1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Move all scripts and documentation to Python3 (#6378)

* Move all scripts and documentation to Python3

Python 2 EOL is Jan 1, 2020.  Migrate scripts to run under Python 3.

Under Windows, we're already running Python 3.7, by dumb luck.  The
oddness is that the Windows standalone executable for Python 3 is called
"python" whereas under UNIX-like OSes it's called "python3" with
"python" always referring to the Python 2 executable.  The ZIP needs to
be updated to include a Python3.exe (copy of Python.exe) so that we can
use the same command lines under Linux and Windows, and to preserve my
sanity.

Fixes #6376

* Add new Windows ZIP with python3.exe file

* Sort options in boards.txt generation for repeatability

The order of the board opts dict changes depending on the Python version
and machine, so sort the options before printing them to get a stable
ordering.

* Re-add Python2 compatibility tweaks

Most scripts can run as Python 2 or Python 3 with minimal changes, so
re-add (and fix, as necessary) compatibility tweaks to the scripts.
This commit is contained in:
Earle F. Philhower, III
2019-08-28 12:42:48 -07:00
committed by GitHub
parent 1800bb5abe
commit 0a031ce957
23 changed files with 112 additions and 102 deletions

View File

@ -14,7 +14,7 @@ ESP8266_BASE = $(ARDUINO_BASE)/hardware/esp8266com/esp8266
ESP8266_TOOLS = $(ESP8266_BASE)/tools
XTENSA_TOOLS_ROOT = $(ESP8266_TOOLS)/xtensa-lx106-elf/bin
PYTHON_BIN = python
PYTHON_BIN = python3
ESPTOOL_PY_BIN = $(ESP8266_TOOLS)/esptool.py
ESPOTA_PY_BIN = $(ESP8266_TOOLS)/espota.py
ESPTOOL_BIN = $(ESP8266_TOOLS)/esptool/esptool.exe

View File

@ -43,7 +43,7 @@ Prerequisites
- Arduino 1.6.8 (or newer, current working version is 1.8.5)
- git
- Python 2.7 (https://python.org)
- Python 3.x (https://python.org)
- terminal, console, or command prompt (depending on your OS)
- Internet connection
@ -110,7 +110,7 @@ Instructions - Windows 10
.. code:: bash
cd esp8266/tools
python get.py
python3 get.py
- Restart Arduino
@ -184,7 +184,7 @@ Instructions - Other OS
.. code:: bash
cd esp8266/tools
python get.py
python3 get.py
- Restart Arduino

View File

@ -193,7 +193,7 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa
- esp8266/Arduino platform package 2.0.0 or newer - for instructions
follow
https://github.com/esp8266/Arduino#installing-with-boards-manager
- Python 2.7 - https://www.python.org/
- Python 3.x - https://www.python.org/
**Note:** Windows users should select “Add python.exe to Path”
(see below this option is not selected by default).