Page 1 of 1

What is raw REPL

Posted: Sat May 17, 2014 11:09 am
by Markus Gritsch
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?

Re: What is raw REPL

Posted: Sat May 17, 2014 1:31 pm
by dhylands
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.

Re: What is raw REPL

Posted: Sat May 17, 2014 1:45 pm
by fma
Yes, it seems very usefull ! Thanks for the tip.

Re: What is raw REPL

Posted: Sat May 17, 2014 2:45 pm
by Markus Gritsch
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?

Re: What is raw REPL

Posted: Sat May 17, 2014 3:04 pm
by dhylands
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.

Re: What is raw REPL

Posted: Sat May 17, 2014 3:12 pm
by Markus Gritsch
ok. Thank you for the quick and detailed answer!