Re: [jupyter] interact with command-line tools from the notebook

2017-06-12 Thread Lawrence D’Oliveiro
On Monday, June 12, 2017 at 11:27:08 PM UTC+12, takowl wrote:
>
> On 10 June 2017 at 00:12, Lawrence D’Oliveiro  > wrote:
>
>> Isn’t that what select  
>> is for? 
>
>
> select() will tell you whether there's space in a buffer to write to for a 
> given fd. But you can write to the master side of a pty regardless of what 
> the process in it is doing ...
>

Ah. I knew there was a good reason why command-line tools should be able to 
operate without having to do interactive I/O ... 

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/d4d671fa-9028-4ba4-9781-1e958a429032%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] interact with command-line tools from the notebook

2017-06-12 Thread Thomas Kluyver
On 10 June 2017 at 00:12, Lawrence D’Oliveiro 
wrote:

> Isn’t that what select  is
> for?


select() will tell you whether there's space in a buffer to write to for a
given fd. But you can write to the master side of a pty regardless of what
the process in it is doing - type 'sleep 10' into bash, and then try typing
letters while it is doing nothing. We can't tell whether the process on the
other side of the pty is actually waiting for input, only that the input
buffer isn't full. That's why tools like pexpect can be used to look for
know patterns like 'password: '.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qi4YFaTXUN9mW5m-a7%2B-rRdRnm0YWeS93Np3%3DRH9oFO2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] interact with command-line tools from the notebook

2017-06-09 Thread Lawrence D’Oliveiro
On Wednesday, May 17, 2017 at 3:50:33 AM UTC+12, takowl wrote:
>
> There's nothing automatic, because we can't tell when a process is waiting 
> for input.
>

Isn’t that what select  is 
for? 

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/9efc37c3-6a10-41cf-bd85-25422aebcd2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] interact with command-line tools from the notebook

2017-05-16 Thread Denis Akhiyarov
Ok, I understood that this is difficult after trying out 2 options :)
pexpect support on Windows is partial and experimental, hence I will not
even try this. Anyway working with command-line tools right from
ipython/jupyter would be very handy, especially for presentations!

On Tue, May 16, 2017 at 10:49 AM, Thomas Kluyver  wrote:

> There's nothing automatic, because we can't tell when a process is waiting
> for input. If you know what the prompt looks like, you may be able to use
> something like pexpect.replwrap to run it - though I don't know if that
> will work on Windows.
>
> On 16 May 2017 at 13:22, Denis Akhiyarov 
> wrote:
>
>> Is there any way I can interact with command-line tools from the
>> notebook? For example scriptcs embeds itself in cmd as a REPL.
>>
>> In the notebook it is not interactive. In fact I cannot even kill the
>> scriptcs process () when it is called in the notebook:
>>
>> taskkill /f /im scriptcs*
>> ERROR: The process "scriptcs*" not found.
>>
>>
>> 
>>
>>
>>
>> 
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jupyter+unsubscr...@googlegroups.com.
>> To post to this group, send email to jupyter@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/jupyter/5bbeff4d-25f3-4e92-86aa-31a6d3c3636d%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Project Jupyter" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jupyter/linMSNXHiEs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/CAOvn4qg735SAWp_M%3D0SJWVd-skmzrj%2BoNTM%
> 2BPq7_H49okAHG%2Bg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CALxxJLR93nd_QMegYkz0yQtMsRb5LK7%2BN66_FZ-zCjJ2GBRp6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] interact with command-line tools from the notebook

2017-05-16 Thread Thomas Kluyver
There's nothing automatic, because we can't tell when a process is waiting
for input. If you know what the prompt looks like, you may be able to use
something like pexpect.replwrap to run it - though I don't know if that
will work on Windows.

On 16 May 2017 at 13:22, Denis Akhiyarov  wrote:

> Is there any way I can interact with command-line tools from the notebook?
> For example scriptcs embeds itself in cmd as a REPL.
>
> In the notebook it is not interactive. In fact I cannot even kill the
> scriptcs process () when it is called in the notebook:
>
> taskkill /f /im scriptcs*
> ERROR: The process "scriptcs*" not found.
>
>
> 
>
>
>
> 
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/5bbeff4d-25f3-4e92-86aa-31a6d3c3636d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qg735SAWp_M%3D0SJWVd-skmzrj%2BoNTM%2BPq7_H49okAHG%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] interact with command-line tools from the notebook

2017-05-16 Thread Denis Akhiyarov


Is there any way I can interact with command-line tools from the notebook? 
For example scriptcs embeds itself in cmd as a REPL.

In the notebook it is not interactive. In fact I cannot even kill the 
scriptcs process () when it is called in the notebook:

taskkill /f /im scriptcs*
ERROR: The process "scriptcs*" not found.










-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/5bbeff4d-25f3-4e92-86aa-31a6d3c3636d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.