[SOLVED] micropython REPL auto indent

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jpj
Posts: 60
Joined: Sat Dec 10, 2016 3:07 pm

[SOLVED] micropython REPL auto indent

Post by jpj » Sun Jan 01, 2017 7:51 pm

I like how micropython will automatically indent when I'm entering code in the REPL, like an "if" or "for" statement followed by return key. Is there a way to enable this functionality in regular Python at an operating system level, i.e. python3 in Linux? I've Google searched and not found a way.

Thanks,
J

Code: Select all

>>> for i in range(3):
...     print(i)
...
...
...
0
1
2
Last edited by jpj on Mon Jan 02, 2017 1:02 am, edited 1 time in total.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: micropython REPL auto indent

Post by rcolistete » Sun Jan 01, 2017 8:16 pm

My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

jpj
Posts: 60
Joined: Sat Dec 10, 2016 3:07 pm

Re: micropython REPL auto indent

Post by jpj » Sun Jan 01, 2017 8:19 pm

Thanks. Any method to enable auto-indent without using IPython?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: micropython REPL auto indent

Post by deshipu » Sun Jan 01, 2017 11:47 pm

There are a number of different alternate Python shells that offer this functionality: ipython, bpython, ptpython, etc.
You can use any of them.


jpj
Posts: 60
Joined: Sat Dec 10, 2016 3:07 pm

Re: [SOLVED] micropython REPL auto indent

Post by jpj » Mon Jan 02, 2017 5:45 am

Thanks rcolistete, deshipu, and Dave.

I tried a few different python shells out and am using the ipython Dave linked too.

Regards,
J

Post Reply