当前位置: 首页>>代码示例>>Python>>正文


Python widgets.HTML属性代码示例

本文整理汇总了Python中ipywidgets.widgets.HTML属性的典型用法代码示例。如果您正苦于以下问题:Python widgets.HTML属性的具体用法?Python widgets.HTML怎么用?Python widgets.HTML使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ipywidgets.widgets的用法示例。


在下文中一共展示了widgets.HTML属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: config_tab

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def config_tab(self):
        config = get_config()
        if config.ready:
            config_items = list(config.as_dict().items())
            config_items.sort()
            config_tab = widgets.HTML(config_template.render(config=config_items))
        else:
            config_tab = widgets.HTML("Not loaded.")
        return config_tab 
开发者ID:Dallinger,项目名称:Dallinger,代码行数:11,代码来源:jupyter.py

示例2: render

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def render(self, change=None):
        header = widgets.HTML(
            header_template.render(
                name=self.exp.task, status=self.status, app_id=self.exp.app_id
            )
        )

        tabs = widgets.Tab(children=[self.config_tab])
        tabs.set_title(0, "Configuration")
        self.children = [header, tabs] 
开发者ID:Dallinger,项目名称:Dallinger,代码行数:12,代码来源:jupyter.py

示例3: DrawDecisionTree

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def DrawDecisionTree(fac, datasetName, methodName):
    m = GetMethodObject(fac, datasetName, methodName)
    if m==None:
        return None
    tr = TreeReader(str(m.GetWeightFileName()))

    variables = tr.getVariables();

    def clicked(b):
        if treeSelector.value>tr.getNTrees():
            treeSelector.value = tr.getNTrees()
        clear_output()
        toJs = {
            "variables": variables,
            "tree": tr.getTree(treeSelector.value)
        }
        json_str = json.dumps(toJs)
        JPyInterface.JsDraw.Draw(json_str, "drawDecisionTree", True)

    mx = str(tr.getNTrees()-1)

    treeSelector = widgets.IntText(value=0, font_weight="bold")
    drawTree     = widgets.Button(description="Draw", font_weight="bold")
    label        = widgets.HTML("<div style='padding: 6px;font-weight:bold;color:#333;'>Decision Tree [0-"+mx+"]:</div>")

    drawTree.on_click(clicked)
    container = widgets.HBox([label,treeSelector, drawTree])
    display(container)

## This function puts the main thread to sleep until data points for tracking plots appear.
# @param m Method object
# @param sleep_time default sleeping time 
开发者ID:dnanexus,项目名称:parliament2,代码行数:34,代码来源:Factory.py

示例4: setUp

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def setUp(self):
        self.children = [HTML('0'), HTML('1')] 
开发者ID:luckystarufo,项目名称:pySINDy,代码行数:4,代码来源:test_selectioncontainer.py

示例5: load_json

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def load_json(self, json_text):
        # Allow use of widgets:
        if widgets is None:
            return
        json = eval(json_text.strip(), {key: getattr(widgets, key) for key in dir(widgets)})
        if json.get("results_filename", None):
            self.results_filename = json["results_filename"]
        if json.get("instructors", []):
            for instructor in json["instructors"]:
                self.instructors.append(instructor)
        if json["activity"] == "poll":
            self.index = 0
            for item in json["items"]:
                if item["type"] == "multiple choice":
                    # FIXME: allow widgets; need to rewrite create/show:
                    question = item["question"]
                    #if isinstance(question, str):
                    #    question = widgets.HTML(question)
                    options = item["options"]
                    #for pos in range(len(options)):
                    #    option = options[pos]
                    #    if isinstance(option, str):
                    #        options[pos] = widgets.HTML(option)
                    q = Question(item["id"], question, options)
                    self.questions.append(q)
                else:
                    raise Exception("not a valid question 'type': use ['multiple choice']")
            self.create_widget()
            self.use_question(self.index)
        else:
            raise Exception("not a valid 'activity': use ['poll']") 
开发者ID:Calysto,项目名称:metakernel,代码行数:33,代码来源:activity_magic.py

示例6: create_widget

# 需要导入模块: from ipywidgets import widgets [as 别名]
# 或者: from ipywidgets.widgets import HTML [as 别名]
def create_widget(self):
        self.id_widget = widgets.HTML("")
        self.question_widget = widgets.HTML("")
        self.choice_widgets = []
        self.choice_row_list = []
        for count in range(1, 5 + 1):
            self.choice_widgets.append(widgets.HTML(""))
            self.choice_row_list.append(widgets.HBox([widgets.HTML("<b>%s</b>)&nbsp;&nbsp;" % count),
                                                      self.choice_widgets[-1]]))
        self.buttons = []
        for i in range(1, 5 + 1):
            button = widgets.Button(description = str(i))
            button.on_click(self.handle_submit)
            button.layout.margin = "20px"
            self.buttons.append(button)
        self.respond_row_widgets = widgets.HBox([widgets.HTML("""<br/><br clear="all"/><b>Respond</b>: """)] + self.buttons)
        self.next_button = widgets.Button(description="Next")
        self.next_button.on_click(self.handle_next)
        self.results_button = widgets.Button(description="Results")
        self.results_button.on_click(self.handle_results)
        self.prev_button = widgets.Button(description="Previous")
        self.prev_button.on_click(self.handle_prev)
        self.results_html = widgets.HTML("")
        self.top_margin = widgets.HTML("")
        #self.top_margin.layout.height = "100px"
        right_stack = widgets.VBox([self.top_margin, self.results_html])
        self.stack = widgets.VBox([self.id_widget, self.question_widget] + self.choice_row_list +
                                  [self.respond_row_widgets,
                                   widgets.HBox([self.prev_button, self.results_button, self.next_button])])
        self.output = widgets.Output()
        self.top_level = widgets.VBox([widgets.HBox([self.stack, right_stack]),
                                       self.output]) 
开发者ID:Calysto,项目名称:metakernel,代码行数:34,代码来源:activity_magic.py


注:本文中的ipywidgets.widgets.HTML属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。