☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

reloading python modules when the webpage is refreshed

Community Support
Saba_Arife_Bozpolat
Saba_Arife_Bozpolat

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?

⌁   Link to post
Bryan
Bryan

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, saba.bozpolat@gmail.com 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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
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\.

⌁   Link to post
Saba_Arife_Bozpolat
Saba_Arife_Bozpolat

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, saba.b...@gmail.com 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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

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.

⌁   Link to post

End of archived discussion · Replies are disabled