Thank you for your answer!

I am also thinking about a jupyterlab plugin which enables the 
communication with the Kernel.
However, I am unsure on how to exactly "trigger" the custom plugin.

So, imagine, I have a Python script. And when I run this script or a line 
of Python (maybe the script is also located in a library), I want this to 
not only execute the current cell but also paste code into the next cell 
AND execute the next cell. Because I am basically "auto-generating" 
multiple separate outputs for the user.

One possible solution that I see right now is that my custom plugin could 
listen to the execution of cells and check if there is some special code 
inside and then trigger some custom Javascript action to add a new cell, 
fill it with necessary code and execute it.
However, this does not feel right. Also, the content of the next cell might 
be variable based on the results of the "initial" cell.

Is there a better way of triggering my plugin from Python code for this 
specific scenario? In the ideal case, I can call a function in my extension 
and pass it some arguments from Python. This seems similar to a display() 
call where another extension is triggered to handle the display of the 
output. So, this seems related but maybe not completely?



Am Mittwoch, 5. Dezember 2018 11:59:28 UTC+1 schrieb Min RK:
>
> I don't believe JupyterLab allows this kind of frontend-action triggered 
> from the kernel, at least not at this point. I think you would have to 
> install a jupyterlab plugin to enable the necessary hooks.
>
> On Fri, Nov 30, 2018 at 11:13 AM Florian Wetschoreck <
> florian.w...@gmail.com <javascript:>> wrote:
>
>> Small extension/clarification:
>>
>> I want this to work in JupyterLab. (In JupyterNotebook I can just execute 
>> the next cell with Javascript.)
>>
>>
>>
>> Am Freitag, 30. November 2018 11:10:48 UTC+1 schrieb Florian Wetschoreck:
>>>
>>> Hi,
>>>
>>> I want to set the input for the next cell and afterwards execute the 
>>> next cell.
>>>
>>> Currently, I can write in my Python cell:
>>>
>>> get_ipython().set_next_input("print('Hello World')")
>>>
>>>
>>> But this only fills the next input. How can I also execute the next cell 
>>> from my current cell using Python?
>>>
>>> Any help is highly appreciated!
>>>
>>> Florian
>>>
>>>
>>>
>>>
>>> -- 
>> 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+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to jup...@googlegroups.com 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/4ed95124-f02a-4ccf-a1c2-de23ce3b2b39%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jupyter/4ed95124-f02a-4ccf-a1c2-de23ce3b2b39%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/aabd57e5-fe13-4bb2-8564-93c1a7c85172%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to