本文整理匯總了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)
示例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)
示例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')
示例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