reloading python modules when the webpage is refreshed

Hi,

I have a bokeh code, since it contains more than 400 lines I have splitted the code into modules.

The code is working as before but when I refresh the web page it shows nothing.

Example:

button.py
from bokeh.models import Button
button1 = Button(label=“Push me!”)

main.py
from bokeh.io import curdoc
from button import button1

def foo():
do something

button1.on_click(foo)

curdoc.add_root(row(button1))

The problem is that:

When I first load the page, button is perfectly working.

When I reload the page nothing is shown on the screen.

How can I reload the modules when F5 is hit or the webpage is refreshed somehow?

Hi,

There are examples in the repo that import and use modules that work on re-load. It's not possible to diagnose what might be going amiss with your specific situation without more information. Please add a complete, minimal example code to reproduce what you are seeing, as well as an relevant log messages (from the server or in the JS console).

Thanks,

Bryan

···

On Nov 8, 2017, at 12:05, [email protected] wrote:

Hi,

I have a bokeh code, since it contains more than 400 lines I have splitted the code into modules.
The code is working as before but when I refresh the web page it shows nothing.

Example:

button.py
from bokeh.models import Button
button1 = Button(label="Push me!")

main.py
from bokeh.io import curdoc
from button import button1

def foo():
    do something

button1.on_click(foo)

curdoc.add_root(row(button1))

The problem is that:
    When I first load the page, button is perfectly working.
    When I reload the page nothing is shown on the screen.

How can I reload the modules when F5 is hit or the webpage is refreshed somehow?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7e44662f-b70e-4b75-8a87-65ffe2cee9d7%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Could you please send a link of one of those examples?

···

On Wednesday, November 8, 2017 at 9:21:36 PM UTC+3, Bryan Van de ven wrote:

Hi,

There are examples in the repo that import and use modules that work on re-load. It’s not possible to diagnose what might be going amiss with your specific situation without more information. Please add a complete, minimal example code to reproduce what you are seeing, as well as an relevant log messages (from the server or in the JS console).

Thanks,

Bryan

On Nov 8, 2017, at 12:05, [email protected] wrote:

Hi,

I have a bokeh code, since it contains more than 400 lines I have splitted the code into modules.

The code is working as before but when I refresh the web page it shows nothing.

Example:

button.py

from bokeh.models import Button

button1 = Button(label=“Push me!”)

main.py

from bokeh.io import curdoc

from button import button1

def foo():

do something

button1.on_click(foo)

curdoc.add_root(row(button1))

The problem is that:

When I first load the page, button is perfectly working.
When I reload the page nothing is shown on the screen.

How can I reload the modules when F5 is hit or the webpage is refreshed somehow?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7e44662f-b70e-4b75-8a87-65ffe2cee9d7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.