本文整理汇总了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