• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

pbugnion/ipywidgets_server: [unmaintained] Run Jupyter widgets outside of the no ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

pbugnion/ipywidgets_server

开源软件地址:

https://github.com/pbugnion/ipywidgets_server

开源编程语言:

JavaScript 56.0%

开源软件介绍:

[Unmaintained] Jupyter widgets server

This project is in sunset mode. It is no longer actively maintained.

To serve widgets and rich outputs, we recommend using voila instead. See this issue for a discussion.












Documentation Status

Ever wanted to display Jupyter widgets outside of a notebook environment? This lets you do it.

For more information, view the docs page.

Warnings

You probably should not use this in production yet.

This only supports Python 3.6 at present (PRs welcome)!

Installation

You should install ipywidgets_server with pip:

$ pip install ipywidgets_server

To install from source, clone this repository and run:

$ cd ipywidgets_server/
$ pip install -e .

Usage

Create a python file (not a notebook) that renders your favourite widget. Let's, for instance, create a file called example.py that contains:

# example.py

from ipywidgets import IntSlider, Text, VBox
s = IntSlider(max=200, value=100)
t = Text()

def update_text(change=None):
    t.value = str(float(s.value) ** 2)

s.observe(update_text, names='value')
update_text()
vbox = VBox([s, t])

To serve the widget, go to the directory containing example.py and run:

$ ipywidgets-server example:vbox

This will serve the widget on http://localhost:8866:

example-widget

The command line argument is <module name>:<object name>, where <module name> is the name of a Python module that can be imported, and <object name> is the name of the variable that holds the widget to display.

For information on other command line arguments, run:

$ ipywidgets-server --help

Credit where it's due

Much of the frontend code for this is inspired by the web3 example in ipywidgets.

The original idea of writing a custom kernel to stop arbitrary code execution on the server came from Maarten Breddels.

Most of the implementation is inspired by various parts of ipywidgets and Jupyter.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ORION6194/jupyterNotebooks发布时间:2022-07-09
下一篇:
osscar-org/quantum-mechanics: A collection of jupyter notebooks for quantum mech ...发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap