[Python-ideas] Option of running shell/console commands inside the REPL

Chris Angelico rosuav at gmail.com
Fri Feb 1 15:45:43 EST 2019


On Sat, Feb 2, 2019 at 7:32 AM Oleg Broytman <phd at phdru.name> wrote:
>
> On Fri, Feb 01, 2019 at 03:12:42PM -0500, Terry Reedy <tjreedy at udel.edu> wrote:
> > On 2/1/2019 1:50 PM, James Lu wrote:
> > > It???s difficult to learn anything with a body (such as a loop or a class or a function) with the built in REPL because you can???t edit lines you???ve already written.
> >
> > However, I don't see what this has to do with running system console
> > commands in a Python shell.
>
>    Python REPL is missing the following batteries:
>
> * Persistent history;

Dunno about that - it persists just fine on my system. Maybe it's a
Windows problem? On all my Windows systems, I just use IDLE instead of
the default REPL and have done with it.

> * Syntax highlighting;

Not usually something I need from a REPL. That's a feature for an editor.

> * Clear separation (using, for example, different colors)
>   between input, output and errors;

Input is marked with a prompt (">>>" or "..."). Errors are just
another form of output.

> * Paging of very long output/errors.

This could definitely be improved on. I don't know that this counts as
"missing batteries" though, as the standard library DOES include a
hook that you could use for the purpose (sys.displayhook); it's just a
matter of figuring out a suitable renderer.

ChrisA


More information about the Python-ideas mailing list