What is raw REPL

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

What is raw REPL

Post by Markus Gritsch » Sat May 17, 2014 11:09 am

help() says one can use CTRL-A to enter 'raw REPL'. If I do this, the >>> prompt changes to > but I wonder how to use raw REPL or what it is?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is raw REPL

Post by dhylands » Sat May 17, 2014 1:31 pm

Raw REPL allows python code to be entered and executed on the board from a script.

The pyboard.py script uses this to download code and run it.

Right now this is primarily used as part of the test suite for running tests on the board, but it could be useful for development as well.

fma
Posts: 164
Joined: Wed Jan 01, 2014 5:38 pm
Location: France

Re: What is raw REPL

Post by fma » Sat May 17, 2014 1:45 pm

Yes, it seems very usefull ! Thanks for the tip.
Frédéric

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: What is raw REPL

Post by Markus Gritsch » Sat May 17, 2014 2:45 pm

I see. But what's the advantage of putting the REPL in raw mode and sending the text as bytes(), compared to using the normal REPL and sending the text as text? Is it to get rid of the echoed back characters?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is raw REPL

Post by dhylands » Sat May 17, 2014 3:04 pm

Markus Gritsch wrote:I see. But what's the advantage of putting the REPL in raw mode and sending the text as bytes(), compared to using the normal REPL and sending the text as text? Is it to get rid of the echoed back characters?
Primarily - yeah. You can think of raw REPL as a programmatic interface, and regular REPL as a human interface.

The raw REPL also makes it much easier (from the script's perspective) to determine exactly what the real output of a command (like print) is.

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: What is raw REPL

Post by Markus Gritsch » Sat May 17, 2014 3:12 pm

ok. Thank you for the quick and detailed answer!

Post Reply