Save a curdoc() in Bokeh

Hello everyone,

I’m a beginner in Bokeh. I would like to know if it is possible to save a curdoc () in an HTML file? I put my little test code in the attachment.

Thanks.

mytest.py (1.65 KB)

Hi,

This is a Bokeh application In order to function, it cannot be saved, it must be *executed* by a Bokeh server. i.e. if your code below is in a file mytest.py, then the only way to get it function and perform is to run

  bokeh serve --show mutest.py

at your command line. There is no way to "save" it such that it will run without a Bokeh Server. There are other ways besides scripts to specify and build applications, but to operate, they all must be run inside Bokeh serve. See:

  http://bokeh.pydata.org/en/latest/docs/user_guide/server.html

Alernatively, if you don't need to execute real, actual Python code in your callbacks, you can have many highly interactive standalone (i.e. no Bokeh server) plots with things like CustomJS callbacks. See:

  http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets

Thanks,

Bryan

···

On Sep 5, 2017, at 06:20, [email protected] wrote:

Hello everyone,

I'm a beginner in Bokeh. I would like to know if it is possible to save a curdoc () in an HTML file? I put my little test code in the attachment.

Thanks.

--
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/85e0b74e-8005-43dd-95ae-f27aaecb8280%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
<mytest.py>

Hi,

Thank you for your reply. But, I need to call a Python function in my callbacks. Previously, I tryed to use CustomJS callbacks but I don’t know how to call a Python function, which I have already created in my script, with CustomJS.

Thanks,

Bao.

···

2017-09-05 16:00 GMT+02:00 Bryan Van de ven [email protected]:

Hi,

This is a Bokeh application In order to function, it cannot be saved, it must be executed by a Bokeh server. i.e. if your code below is in a file mytest.py, then the only way to get it function and perform is to run

    bokeh serve --show mutest.py

at your command line. There is no way to “save” it such that it will run without a Bokeh Server. There are other ways besides scripts to specify and build applications, but to operate, they all must be run inside Bokeh serve. See:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/server.html](http://bokeh.pydata.org/en/latest/docs/user_guide/server.html)

Alernatively, if you don’t need to execute real, actual Python code in your callbacks, you can have many highly interactive standalone (i.e. no Bokeh server) plots with things like CustomJS callbacks. See:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets)

Thanks,

Bryan

On Sep 5, 2017, at 06:20, [email protected] wrote:

Hello everyone,

I’m a beginner in Bokeh. I would like to know if it is possible to save a curdoc () in an HTML file? I put my little test code in the attachment.

Thanks.

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/85e0b74e-8005-43dd-95ae-f27aaecb8280%40continuum.io.

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

<mytest.py>

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/BC3FC96F-29DC-43E1-967D-9636E3B0F3AA%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

If you need to run real python, then the app must be run in a Bokeh server, full stop. The Bokeh server is the thing that actually runs the python code, since browsers have no ability to run python code.

Thanks,

Bryan

···

On Sep 5, 2017, at 09:10, Ngoc Bao Tran LE <[email protected]> wrote:

Hi,

Thank you for your reply. But, I need to call a Python function in my callbacks. Previously, I tryed to use CustomJS callbacks but I don't know how to call a Python function, which I have already created in my script, with CustomJS.

Thanks,

Bao.

2017-09-05 16:00 GMT+02:00 Bryan Van de ven <[email protected]>:
Hi,

This is a Bokeh application In order to function, it cannot be saved, it must be *executed* by a Bokeh server. i.e. if your code below is in a file mytest.py, then the only way to get it function and perform is to run

        bokeh serve --show mutest.py

at your command line. There is no way to "save" it such that it will run without a Bokeh Server. There are other ways besides scripts to specify and build applications, but to operate, they all must be run inside Bokeh serve. See:

        http://bokeh.pydata.org/en/latest/docs/user_guide/server.html

Alernatively, if you don't need to execute real, actual Python code in your callbacks, you can have many highly interactive standalone (i.e. no Bokeh server) plots with things like CustomJS callbacks. See:

        http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets

Thanks,

Bryan

> On Sep 5, 2017, at 06:20, [email protected] wrote:
>
> Hello everyone,
>
> I'm a beginner in Bokeh. I would like to know if it is possible to save a curdoc () in an HTML file? I put my little test code in the attachment.
>
> Thanks.
>
> --
> 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/85e0b74e-8005-43dd-95ae-f27aaecb8280%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.
> <mytest.py>

--
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/BC3FC96F-29DC-43E1-967D-9636E3B0F3AA%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
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/CAEVwjr6cD6-wXd0NpRT2YxEYQ3SY6btb4YAxa5jfdXZJwhrdkA%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Ak ok.

Thank you for your help,

Bao.

···

2017-09-05 16:12 GMT+02:00 Bryan Van de ven [email protected]:

Hi,

If you need to run real python, then the app must be run in a Bokeh server, full stop. The Bokeh server is the thing that actually runs the python code, since browsers have no ability to run python code.

Thanks,

Bryan

On Sep 5, 2017, at 09:10, Ngoc Bao Tran LE [email protected] wrote:

Hi,

Thank you for your reply. But, I need to call a Python function in my callbacks. Previously, I tryed to use CustomJS callbacks but I don’t know how to call a Python function, which I have already created in my script, with CustomJS.

Thanks,

Bao.

2017-09-05 16:00 GMT+02:00 Bryan Van de ven [email protected]:

Hi,

This is a Bokeh application In order to function, it cannot be saved, it must be executed by a Bokeh server. i.e. if your code below is in a file mytest.py, then the only way to get it function and perform is to run

    bokeh serve --show mutest.py

at your command line. There is no way to “save” it such that it will run without a Bokeh Server. There are other ways besides scripts to specify and build applications, but to operate, they all must be run inside Bokeh serve. See:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/server.html](http://bokeh.pydata.org/en/latest/docs/user_guide/server.html)

Alernatively, if you don’t need to execute real, actual Python code in your callbacks, you can have many highly interactive standalone (i.e. no Bokeh server) plots with things like CustomJS callbacks. See:

    [http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets)

Thanks,

Bryan

On Sep 5, 2017, at 06:20, [email protected] wrote:

Hello everyone,

I’m a beginner in Bokeh. I would like to know if it is possible to save a curdoc () in an HTML file? I put my little test code in the attachment.

Thanks.

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/85e0b74e-8005-43dd-95ae-f27aaecb8280%40continuum.io.

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

<mytest.py>

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/BC3FC96F-29DC-43E1-967D-9636E3B0F3AA%40anaconda.com.

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

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/CAEVwjr6cD6-wXd0NpRT2YxEYQ3SY6btb4YAxa5jfdXZJwhrdkA%40mail.gmail.com.

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

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/02EAD410-8A84-4BA1-9425-243D2C781DBD%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.