1.3.4 REPL
REPL (Read Evaluate Print Loop)
REPL stands for Read Evaluate Print Loop, and is the name given to the interactive
MicroPython prompt that is accessible on the Pycom devices. Using the REPL is by far the
easiest way to test out Python code and run commands. You can use the REPL in addition
to writing scripts in
main.py
The following pages will explain how to use the REPL with both Serial USB and Telnet
connections.
The REPL includes the following features:
Input history: use arrow up and arrow down to scroll through the history
Tab completion: press tab to auto-complete variables or module names
Halt any executing code: with
Copy/paste code or output:
There are a number of useful shortcuts for interacting with the MicroPython REPL. See
below for the key combinations;
on a blank line will enter raw REPL mode. This is similar to permanent
Ctrl-A
paste mode, except that characters are not echoed back.
on a blank like goes to normal REPL mode.
Ctrl-B
cancels any input, or interrupts the currently running code.
Ctrl-C
on a blank line will do a soft reset.
Ctrl-D
enters 'paste mode' that allows you to copy and paste chunks of text. Exit
Ctrl-E
this mode using
performs a "safe-boot" of the device that prevents
Ctrl-F
from executing
.
Ctrl-C
and
Ctrl-C
.
Ctrl-D
Ctrl-V
boot.py
and
main.py
78
Need help?
Do you have a question about the WiPy 3.0 and is the answer not in the manual?
Questions and answers