Re: [Python-ideas] Running Python commands from a Shell

2019-02-01 Thread eryk sun
On 2/1/19, Steven D'Aprano wrote: > On Fri, Feb 01, 2019 at 07:21:47PM -0600, eryk sun wrote: > >> As soon as "pipe" is mentioned, anyone familiar with the REPL's >> behavior with pipes should know that making this work will require the >> -i command-line option to force interactive mode. Otherwi

Re: [Python-ideas] Running Python commands from a Shell

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 07:21:47PM -0600, eryk sun wrote: > bash coproc runs a process in the background with stdin and stdout > redirected to pipes. The file descriptors for our end of the pipes are > available in an array with the given name (e.g. P3). The default array > name is COPROC. Thanks

Re: [Python-ideas] Running Python commands from a Shell

2019-02-01 Thread eryk sun
On 2/1/19, Steven D'Aprano wrote: > On Fri, Feb 01, 2019 at 04:28:25PM -0600, Dan Sommers wrote: > >> As I indicated in what you quoted, shell co-processes allow you to run a >> command in the background and interact with that command from your >> shell. > > Okay, but what does that mean in practi

Re: [Python-ideas] Running Python commands from a Shell

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 04:28:25PM -0600, Dan Sommers wrote: > On 2/1/19 3:48 PM, Steven D'Aprano wrote: > > On Fri, Feb 01, 2019 at 02:38:43PM -0600, Dan Sommers wrote: > > > >> So why not turn that around? ksh (since way back when) and > >> bash (since 2008, according to what I read somewhere on

Re: [Python-ideas] Running Python commands from a Shell

2019-02-01 Thread Dan Sommers
On 2/1/19 3:48 PM, Steven D'Aprano wrote: > On Fri, Feb 01, 2019 at 02:38:43PM -0600, Dan Sommers wrote: > >> So why not turn that around? ksh (since way back when) and >> bash (since 2008, according to what I read somewhere online) >> have "co-processes," which allow you to run a command "in >>

Re: [Python-ideas] Running Python commands from a Shell (was: Option of running shell/console commands inside the REPL)

2019-02-01 Thread Steven D'Aprano
On Fri, Feb 01, 2019 at 02:38:43PM -0600, Dan Sommers wrote: > So why not turn that around? ksh (since way back when) and > bash (since 2008, according to what I read somewhere online) > have "co-processes," which allow you to run a command "in > the background," and send commands and receive rep

Re: [Python-ideas] Running Python commands from a Shell (was: Option of running shell/console commands inside the REPL)

2019-02-01 Thread Chris Angelico
On Sat, Feb 2, 2019 at 7:39 AM Dan Sommers <[email protected]> wrote: > > On 2/1/19 2:26 AM, João Matos wrote: > > Hello, > > > > > > Consider adding the option of running shell/console commands inside the > > REPL. > > Something like > !dir (This might be better on python-li

Re: [Python-ideas] Running Python commands from a Shell (was: Option of running shell/console commands inside the REPL)

2019-02-01 Thread Dan Sommers
On 2/1/19 2:26 AM, João Matos wrote: Hello, Consider adding the option of running shell/console commands inside the REPL. Something like !dir I first ran into this in the days of teletypes and dumb terminals, where other programs let you run shell commands from inside them. Now the shoe app