本文整理汇总了Python中html.HTML.body方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.body方法的具体用法?Python HTML.body怎么用?Python HTML.body使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html.HTML
的用法示例。
在下文中一共展示了HTML.body方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _sprite_proof
# 需要导入模块: from html import HTML [as 别名]
# 或者: from html.HTML import body [as 别名]
def _sprite_proof(self, sprite_width, sprite_height, sprite_layout):
""" Create a sprite proof showing how the image was cut. Should look like
original. """
h = HTML('html')
head = h.head()
title = h.title('Sprite Proof')
stylesheet = head.link(href="%s.css" % self.scale, rel="stylesheet",
type="text/css")
style = head.style(type="text/css")
style.raw_text("""
.pc {
position: absolute;
text-indent: -999em;
}
.pc:hover {
text-indent: 0;
}
""")
body = h.body()
for (k, v) in self.pieces.items():
x = v[0]
y = v[1]
el = body.div(klass='pc pc-%s-%s' % (self.scale, k),
style="left:%spx;top:%spx;" % (x, y))
el.text(str(k))
f = open(os.path.join(self._mydir, 'sprite_proof.html'), 'w')
f.write(str(h))
f.close()
示例2: TimeUtility
# 需要导入模块: from html import HTML [as 别名]
# 或者: from html.HTML import body [as 别名]
from diagnosisutils.timeutils import TimeUtility
# create time utility object
timobj = TimeUtility()
# created index object from HTML() class which should create open & close tags
html = HTML('html')
head = html.head()
title = head.title('Model Diagnosis')
css = head.link(rel="stylesheet", type="text/css", href="css/diagnosis.css")
jq = head.script(type="text/javascript", src="js/jquery-1.7.min.js")
jq.text("")
js = head.script(type="text/javascript", src="js/diagnosis.js")
js.text("")
# created body tag
body = html.body()
b = body.div(name = 'body', klass = 'bodyCls')
b.br
heading = b.div(name = 'heading', klass = 'headingCls')
heading.h1('Model Diagnosis Plots')
flag = True
count = 3
form = b.form()
txt = form.div(id = "txtdiv")
txt.p("Choose a model")
# sphinx documentation link
docdiv = form.div(name = 'docdiv')
doclink = docdiv.a(id = 'docdivid', href = 'doc/index.html', target = '_blank', klass = '')
doclink.text("Documentation")
示例3: open
# 需要导入模块: from html import HTML [as 别名]
# 或者: from html.HTML import body [as 别名]
output = open(datafile, 'wb')
cPickle.dump(recipes, output)
else:
infile = open(datafile, 'rb')
recipes = cPickle.load(infile)
infile.close()
return recipes
gw2 = gw2spidy.Gw2Spidy()
print "Content-type: text/html\n"
page = HTML('html')
body = page.body()
populateScripts(body)
body.ul.li("All prices in silver")
body.ul.li("Instant profit = craft, sell to highest buyer")
body.ul.li("Flip profit = buy at highest buyer, sell at lowest seller")
body.ul.li("Craft profit = Craft, sell at lowest seller")
form = body.form("Filter:", style="margin-left: 10px;")
form.input(' ', type="text", name="filtrpt", onkeyup="filter2(this,'recipes')")
tab = body.table(id="recipes", klass="tablesorter", border="1")
thead = tab.thead()
thead.th("Name")
thead.th("Mat Cost")
thead.th("Highest Buy")
thead.th("Lowest Sell")
thead.th("Instant Profit")