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

2019-02-05 Thread Lele Gaifax
Lele Gaifax writes: > Steven D'Aprano writes: > >> One readline feature To be exact, it's not a feature of the readline library: see https://bugs.python.org/issue8 (sigh, my GH fork of cpython has been recreated so some refs are broken). ciao, lele. -- nickname: Lele Gaifax | Quando

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

2019-02-05 Thread Lele Gaifax
Steven D'Aprano writes: > One readline feature I know of which I would love to see supported in > the REPL is the "execute and next line" command. On my bash system, it > is Ctrl-O. I implemented and offered the feature, but unfortunately it is just a couple of lines copied from bash, and

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

2019-02-03 Thread Oleg Broytman
On Sun, Feb 03, 2019 at 10:24:12PM +1100, Steven D'Aprano wrote: > I'm not sure what multiline editing is being referred to above. I > personally don't know of one in bash. It may be that you have to turn > the feature on -- by default, bash ships with a fair amount of stuff > turned off, and

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

2019-02-03 Thread Steven D'Aprano
On Sat, Feb 02, 2019 at 07:37:56PM -0500, Terry Reedy wrote: [...] > >>>* Syntax highlighting; > > To do this correctly requires a separate programmable repl that sees > each character as it is entered. To me, this is as useful in the repl > as in an editor. That's an ambiguous sentence. It

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

2019-02-02 Thread Oleg Broytman
On Sun, Feb 03, 2019 at 02:52:31AM +0100, Oleg Broytman wrote: > On Sat, Feb 02, 2019 at 07:37:56PM -0500, Terry Reedy > wrote: > > On 2/2/2019 8:13 AM, Oleg Broytman wrote: > > > > IDLE does this. > > > > > > For the question "Does Python REPL need more batteries?" is your > > > answer

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

2019-02-02 Thread Oleg Broytman
On Sat, Feb 02, 2019 at 07:37:56PM -0500, Terry Reedy wrote: > On 2/2/2019 8:13 AM, Oleg Broytman wrote: > > > IDLE does this. > > > > For the question "Does Python REPL need more batteries?" is your > > answer "No, just point people to IDLE"? > > If one want these batteries *today*, that

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

2019-02-02 Thread Terry Reedy
On 2/2/2019 8:13 AM, Oleg Broytman wrote: On Fri, Feb 01, 2019 at 08:40:22PM -0500, Terry Reedy wrote: On 2/1/2019 3:31 PM, Oleg Broytman wrote: Python REPL is missing the following batteries: That is why, on Windows, I nearly always use IDLE. I believe this was Chris, not me. *

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

2019-02-02 Thread David Mertz
On Sat, Feb 2, 2019, 8:15 AM Oleg BroytmanFor the question "Does Python REPL need more batteries?" is your > answer "No, just point people to IDLE"? >If it is - well, I disagree. I implemented a lot of enhancements for > REPL myself, and I don't like and avoid GUI programs > IPython and

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

2019-02-02 Thread Oleg Broytman
On Sat, Feb 02, 2019 at 03:37:36PM +1100, Steven D'Aprano wrote: > Sorry, I was not as clear as I ought to have been: > > On Sat, Feb 02, 2019 at 02:10:06PM +1100, Steven D'Aprano wrote: > > > > * Clear separation (using, for example, different colors) > > > between input, output and errors;

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

2019-02-02 Thread Oleg Broytman
On Sat, Feb 02, 2019 at 02:10:06PM +1100, Steven D'Aprano wrote: > On Fri, Feb 01, 2019 at 09:31:21PM +0100, Oleg Broytman wrote: > > >Python REPL is missing the following batteries: > > > > * Persistent history; > > On Linux/Unix systems, that has been available for about 18+ years, >

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

2019-02-02 Thread Oleg Broytman
On Fri, Feb 01, 2019 at 08:43:53PM -0600, eryk sun wrote: > On 2/1/19, Terry Reedy wrote: > > On 2/1/2019 3:31 PM, Oleg Broytman wrote: > > > >> Python REPL is missing the following batteries: > >> * Persistent history; > > Python's built-in REPL relies on the readline module for history. In >

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

2019-02-02 Thread Oleg Broytman
On Fri, Feb 01, 2019 at 08:40:22PM -0500, Terry Reedy wrote: > On 2/1/2019 3:31 PM, Oleg Broytman wrote: > > > Python REPL is missing the following batteries: > > That is why, on Windows, I nearly always use IDLE. > > > * Persistent history; > > IDLE's Shell history persists across restarts

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

2019-02-01 Thread Steven D'Aprano
Sorry, I was not as clear as I ought to have been: On Sat, Feb 02, 2019 at 02:10:06PM +1100, Steven D'Aprano wrote: > > * Clear separation (using, for example, different colors) > > between input, output and errors; > > Input always starts with a prompt; exception tracebacks always start >

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

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 09:31:21PM +0100, Oleg Broytman wrote: >Python REPL is missing the following batteries: > > * Persistent history; On Linux/Unix systems, that has been available for about 18+ years, since the rlcompleter module was introduced in Python 2.0:

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

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 04:15:06PM -0500, Terry Reedy wrote: > For repeated use within and between sessions, put 'from os import system > as oss' in a startup file. Then one only needs "oss('dir')". Note that > 'dir' only works on Windows; the unix equivalent is 'ls'. Actually, on some

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

2019-02-01 Thread eryk sun
On 2/1/19, Terry Reedy wrote: > On 2/1/2019 3:31 PM, Oleg Broytman wrote: > >> Python REPL is missing the following batteries: >> * Persistent history; Python's built-in REPL relies on the readline module for history. In Windows you'll need to install pyreadline, an implementation that uses the

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

2019-02-01 Thread Terry Reedy
On 2/1/2019 3:31 PM, Oleg Broytman wrote: Python REPL is missing the following batteries: That is why, on Windows, I nearly always use IDLE. * Persistent history; IDLE's Shell history persists across restarts (which are not available is the standard shell). I cannot remember wanting

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

2019-02-01 Thread Terry Reedy
On 2/1/2019 9:24 AM, Ken Hilton wrote: Hi, As a workaround/alternative, you can just do     >>> import os     >>> os.system('dir') For repeated use within and between sessions, put 'from os import system as oss' in a startup file. Then one only needs "oss('dir')". Note that 'dir' only

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

2019-02-01 Thread Oleg Broytman
On Sat, Feb 02, 2019 at 07:45:43AM +1100, Chris Angelico wrote: > On Sat, Feb 2, 2019 at 7:32 AM Oleg Broytman wrote: > > > > On Fri, Feb 01, 2019 at 03:12:42PM -0500, Terry Reedy > > wrote: > > > On 2/1/2019 1:50 PM, James Lu wrote: > > > > It???s difficult to learn anything with a body

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

2019-02-01 Thread Terry Reedy
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. I presume you mean that it is 'difficult to learn about compound statements and multiline

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

2019-02-01 Thread James Lu
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. Sent from my iPhone > On Feb 1, 2019, at 1:44 PM, Steven D'Aprano wrote: > >> On Fri, Feb 01, 2019 at 09:07:14AM -0500, James Lu

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

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 09:07:14AM -0500, James Lu wrote: > I always use ptipython (ptpython shell over the ipython console) for my > REPLs. The built-in python repl is not *batteries included* in the sense > that it already has what you need to explore the language. What part of the Python

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

2019-02-01 Thread Eric V. Smith
On 2/1/2019 9:07 AM, James Lu wrote: I always use ptipython (ptpython shell over the ipython console) for my REPLs. The built-in python repl is not /batteries included/ in the sense that it already has what you need to explore the language. I wonder, what do the python committers think about

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

2019-02-01 Thread Ken Hilton
Hi, As a workaround/alternative, you can just do >>> import os >>> os.system('dir') Sincerely, Ken Hilton; ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct:

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

2019-02-01 Thread James Lu
I always use ptipython (ptpython shell over the ipython console) for my REPLs. The built-in python repl is not *batteries included* in the sense that it already has what you need to explore the language. I wonder, what do the python committers think about including a stripped-down version of

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

2019-02-01 Thread Lele Gaifax
Further magic comes with https://pypi.org/project/xonsh/ ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929.

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

2019-02-01 Thread Mike Müller
Am 01.02.19 um 09:26 schrieb João Matos: > Hello, > > > Consider adding the option of running shell/console commands inside the REPL. > Something like !dir IPython provides exactly this: pip install ipython than start it with : ipython Get an overview of features with: In [1]:

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

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 08:26:03AM +, João Matos wrote: > Hello, > > Consider adding the option of running shell/console commands inside the > REPL. > Something like > >>>!dir That's a pretty big change, arguably best left for a third-party REPL like iPython (which already supports "magic"

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

2019-02-01 Thread João Matos
Hello, Consider adding the option of running shell/console commands inside the REPL. Something like !dir Best regards, João Matos smime.p7s Description: S/MIME Cryptographic Signature ___ Python-ideas mailing list Python-ideas@python.org