This page (revision-1) was last changed on 2025-07-30 12:46 by Murray Altheim

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
1 2025-07-30 12:46 1 KB Murray Altheim

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 45 lines
!! The REPL
%%info
This is an additional exercise of the [MicroPython Tutorial|MicroPythonTutorial].
%%
__REPL__ stands for ''Read, Evaluate, Print, Loop''. The REPL is how you interact with the Python Interpreter.
Unlike running a file containing Python code, in the REPL you can type commands and instantly see the output
printed out. You can also use the REPL to print out help for methods and objects in Python, list out what
methods are available, and much more.
We'll use the REPL to execute our main.py program. Depending on how you are using Python, you can access the REPL
on a command line, using a command line application (like mpremote or rshell), or within the user interface of a
Python IDE (Integrated Development Environment) like Thonny.
No matter how you get access to the REPL, once you see its command line prompt "{{>>>}}" you can type commands,
hitting {{{RETURN}}} to execute them.
On Linux or the Terminal in Mac OS:
%%repl {{{
► python3
Python 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> print('hello.')
hello.
>>>
}}} %%
Or using rshell, let's execute our main.py script:
%%repl {{{
/pyboard> repl
Entering REPL. Use Control-X to exit.
>
MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>
>>> import main
hello world.
hello again.
>>>
}}} %%