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


Python HTML.body方法代码示例

本文整理汇总了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()
开发者ID:nadar71,项目名称:piecemaker,代码行数:31,代码来源:base.py

示例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")
开发者ID:arulalant,项目名称:mmDiagnosis,代码行数:33,代码来源:generate_plots_html.py

示例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")
开发者ID:elfez,项目名称:gw2utils,代码行数:33,代码来源:gw2recipes.py


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