By chance I determined an bahviour of the REPL prompt, which differs from standard python.
If at the >>> prompt I enter:
print ("[2J")
I get the REPL continuation prompt:
...
until I press Ctrl-D, which the prints the expected string [2J. I do not know whether this is intentional, but it's different.
Placing the print statement in a script works as expected.
Unexpected behaviour of REPL prompt
Re: Unexpected behaviour of REPL prompt
This appears to be related to an issue that was reported on GitHub a few days ago:
https://github.com/micropython/micropython/issues/1387
It can't hurt to report if you are having a problem with as well.
https://github.com/micropython/micropython/issues/1387
It can't hurt to report if you are having a problem with as well.
Re: Unexpected behaviour of REPL prompt
Thanks for fixing that
Robert
Robert
-
- Posts: 68
- Joined: Sat May 03, 2014 11:31 pm
Re: Unexpected behaviour of REPL prompt
I noticed that behavior too. It looks like you were trying to send escape codes... This is what I ended up with:
It clears the screen and puts the cursor in the upper left corner, if your terminal program responds to to VT100 escape codes. It "repaints' from there down, which is frequently a lot nicer than having stuff scrolling off the screen!print("\x1B\x5B2J", end="") #VT100 clear screen
print("\x1B\x5BH", end="") #VT100 upper left corner