mirror of
https://github.com/micropython/micropython.git
synced 2026-05-01 21:30:14 +02:00
5b3c928f53
This improves REPL usage consistency across ports, by utilizing the pyexec code for the unix REPL. Only enabled when MICROPY_USE_READLINE == 1 (the default). Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
58 lines
628 B
Plaintext
58 lines
628 B
Plaintext
MicroPython \.\+ version
|
|
Type "help()" for more information.
|
|
>>> # check REPL allows to continue input
|
|
>>> 1 \\\\
|
|
... + 2
|
|
3
|
|
>>> '"'
|
|
'"'
|
|
>>> "'"
|
|
"'"
|
|
>>> '\\\\''
|
|
"'"
|
|
>>> "\\\\""
|
|
'"'
|
|
>>> '\\\\'('
|
|
"'("
|
|
>>> "\\\\"("
|
|
'"('
|
|
>>> print("\\\\"(")
|
|
"(
|
|
>>> print('\\\\'(')
|
|
'(
|
|
>>> print("\\\\'(")
|
|
'(
|
|
>>> print('\\\\"(')
|
|
"(
|
|
>>> 'abc'
|
|
'abc'
|
|
>>> "abc"
|
|
'abc'
|
|
>>> '''abc
|
|
... def'''
|
|
'abc\\\\ndef'
|
|
>>> """ABC
|
|
... DEF"""
|
|
'ABC\\\\nDEF'
|
|
>>> print(
|
|
... 1 + 2)
|
|
3
|
|
>>> l = [1,
|
|
... 2]
|
|
>>> print(l)
|
|
[1, 2]
|
|
>>> d = {1:'one',
|
|
... 2:'two'}
|
|
>>> print(d[2])
|
|
two
|
|
>>> def f(x):
|
|
... print(x)
|
|
... [K
|
|
>>> f(3)
|
|
3
|
|
>>> if1=1
|
|
>>> if1 = 2
|
|
>>> print(if1)
|
|
2
|
|
>>>
|