當前位置: 首頁>>代碼示例>>Python>>正文


Python tags.p方法代碼示例

本文整理匯總了Python中dominate.tags.p方法的典型用法代碼示例。如果您正苦於以下問題:Python tags.p方法的具體用法?Python tags.p怎麽用?Python tags.p使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dominate.tags的用法示例。


在下文中一共展示了tags.p方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_images

# 需要導入模塊: from dominate import tags [as 別名]
# 或者: from dominate.tags import p [as 別名]
def add_images(self, ims, txts, links, width=400):
        """add images to the HTML file

        Parameters:
            ims (str list)   -- a list of image paths
            txts (str list)  -- a list of image names shown on the website
            links (str list) --  a list of hyperref links; when you click an image, it will redirect you to a new page
        """
        self.t = table(border=1, style="table-layout: fixed;")  # Insert a table
        self.doc.add(self.t)
        with self.t:
            with tr():
                for im, txt, link in zip(ims, txts, links):
                    with td(style="word-wrap: break-word;", halign="center", valign="top"):
                        with p():
                            with a(href=os.path.join('images', link)):
                                img(style="width:%dpx" % width, src=os.path.join('images', im))
                            br()
                            p(txt) 
開發者ID:Mingtzge,項目名稱:2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement,代碼行數:21,代碼來源:html.py

示例2: add_images

# 需要導入模塊: from dominate import tags [as 別名]
# 或者: from dominate.tags import p [as 別名]
def add_images(self, ims, txts, links, K, width=400):
        """add images to the HTML file

        Parameters:
            ims (str list)   -- a list of image paths
            txts (str list)  -- a list of image names shown on the website
            links (str list) --  a list of hyperref links; when you click an image, it will redirect you to a new page
        """
        self.t = table(border=1, style="table-layout: fixed;")  # Insert a table
        self.doc.add(self.t)
        with self.t:
            with tr():
                for im, txt, link in zip(ims, txts, links):
                    with td(style="word-wrap: break-word;", halign="center", valign="top"):
                        with p():
                            with a(href=os.path.join('images', link)):
                                if txt == 'refs':
                                    img(style="width:%dpx" % K*width, src=os.path.join('images', im))
                                else:
                                    img(style="width:%dpx" % width, src=os.path.join('images', im))
                            br()
                            if txt == 'refs':
                                p(txt+':K='+str(K))
                            else:
                                p(txt) 
開發者ID:liweileev,項目名稱:FET-GAN,代碼行數:27,代碼來源:html.py

示例3: visit_Text

# 需要導入模塊: from dominate import tags [as 別名]
# 或者: from dominate.tags import p [as 別名]
def visit_Text(self, node):
        if not self._in_dropdown:
            return tags.p(node.text, _class='navbar-text')
        return tags.li(node.text, _class='dropdown-header') 
開發者ID:jpush,項目名稱:jbox,代碼行數:6,代碼來源:nav.py

示例4: visit_Field

# 需要導入模塊: from dominate import tags [as 別名]
# 或者: from dominate.tags import p [as 別名]
def visit_Field(self, node):
        # FIXME: add error class

        wrap = self._get_wrap(node)

        # add the label
        wrap.add(tags.label(node.label.text, _for=node.id))
        wrap.add(raw(node()))

        if node.description:
            wrap.add(tags.p(node.description, _class='help-block'))

        return wrap 
開發者ID:jpush,項目名稱:jbox,代碼行數:15,代碼來源:forms.py


注:本文中的dominate.tags.p方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。