Quantcast

Where can I put code that will be run every time "using Module" is executed, and not just the first time?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Where can I put code that will be run every time "using Module" is executed, and not just the first time?

Scott Lundberg
In Jupyter it is convenient to dump JS library code to the notebook when "using Module" is run. This is simple to do in the Module's __init__(), and saves a ton of memory since later visualizations can share this common JS library code.

However, if a user re-executes the cell, the library code is gone, because __init__() is not re-run and the output is overwritten. (this will effect the page next time it is reloaded)

Where can I put code that will be run every time "using Module" is executed, and not just the first time?

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Where can I put code that will be run every time "using Module" is executed, and not just the first time?

Yichao Yu

On Nov 2, 2016 8:12 PM, "Scott Lundberg" <[hidden email]> wrote:
>
> In Jupyter it is convenient to dump JS library code to the notebook when "using Module" is run. This is simple to do in the Module's __init__(), and saves a ton of memory since later visualizations can share this common JS library code.
>
> However, if a user re-executes the cell, the library code is gone, because __init__() is not re-run and the output is overwritten. (this will effect the page next time it is reloaded)
>
> Where can I put code that will be run every time "using Module" is executed, and not just the first time?

Not supported

>
> Thanks!

Loading...