bokeh.application.handlers.code#
提供一个Bokeh应用程序处理程序,通过编译和执行Python源代码来构建文档。
此处理程序由Bokeh服务器命令行工具使用,用于构建基于脚本和笔记本运行的应用程序。
def make_doc(doc: Document):
# do work to modify the document, add plots, widgets, etc.
return doc
app = Application(FunctionHandler(make_doc))
server = Server({'/bkapp': app}, io_loop=IOLoop.current())
server.start()
- class CodeHandler(*, source: str, filename: str | PathLike[str], argv: list[str] = [], package: ModuleType | None = None)[源代码]#
运行修改文档的源代码
- __init__(*, source: str, filename: str | PathLike[str], argv: list[str] = [], package: ModuleType | None = None) None [source]#