首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

python脚本生成html

#-*- coding: utf-8 -*- from pyh import * CONST_LIST = [ ['1','AAA','100','100','100','300'],                ['2','BBB','99','99','99','297'],                ['3','CCC','98','98','98','294']] class ToHTML:     def __init__(self,project = 'TEST', version = 'v1.0'):         self.page = PyH('%s 测试报告' % project)         self.project = project     def tablecss(self, table = None, width = '600'):         table.attributes['cellSpacing'] = 1         table.attributes['cellPadding'] = 1         table.attributes['border'] = 1         table.attributes['borderColor'] = 'green'         table.attributes['width'] = 'width'     def tr_title_css(self, tr = None, color = '#B0C4DE'):         tr.attributes['bgcolor'] = color     def gentitle(self, name):         self.page << div(b('%s测试报告' % name), id = 'mydiv')         self.tableGroup = self.page << table()         self.tablecss(self.tableGroup,width = '600')         title_tr_group = self.tableGroup << tr()         self.tr_title_css(title_tr_group)         title_tr_group.attributes['align'] = 'center'         title_tr_group << td('名次',style = 'width:100')         title_tr_group << td('姓名',style = 'width:100')         title_tr_group << td('语文',style = 'width:100')         title_tr_group << td('数学',style = 'width:100')         title_tr_group << td('英语',style = 'width:100')         title_tr_group << td('总分',style = 'width:100')         self.page << br()     def setcontent(self,unit):         value_tr_unit = self.tableGroup << tr()         for unitOne in unit:             value_tr_unit << td('%s' % unitOne)     def genreport(self, filename = 'report.html'):         self.page << '结束:'         try:             self.page << 'finished'         except:             self.page << 'unfinished'         self.page << br()         self.page.printOut(filename) # self test if __name__ == '__main__':     rp = ToHTML('TEST')     rp.gentitle('FORM')     for

02

177本Python最新版国外电子书分享(上)

http://file.allitebooks.com/20180817/Python For Dummies.pdf http://file.allitebooks.com/20180805/MySQL ConnectorPython Revealed.pdf http://file.allitebooks.com/20180722/Learn Raspberry Pi Programming with Python, 2nd Edition.pdf http://file.allitebooks.com/20180719/Instant Pygame for Python Game Development How-to.pdf http://file.allitebooks.com/20180623/Python Graphics.pdf http://file.allitebooks.com/20180603/Web Scraping with Python, 2nd Edition.pdf http://file.allitebooks.com/20180526/Advanced Data Analytics Using Python.pdf http://file.allitebooks.com/20180513/The Python 3 Standard Library by Example.pdf http://file.allitebooks.com/20180512/Data Science Fundamentals for Python and MongoDB.pdf http://file.allitebooks.com/20180312/Dive into Python 3.pdf http://file.allitebooks.com/20180228/Practical Python AI Projects.pdf http://file.allitebooks.com/20180223/Learn Data Analysis with Python.pdf http://file.allitebooks.com/20180218/Beginning Programming with Python For Dummies, 2nd Edition.pdf http://file.allitebooks.com/20180109/Python for the Busy Java Developer.pdf http://file.allitebooks.com/20171221/Practical Machine Learning with Python.pdf http://file.allitebooks.com/20171213/wxPython Recipes.pdf http://file.allitebooks.com/20171126/MicroPython for the Internet of Things.pdf http://file.allitebooks.com/20171124/Make Your Own Python Text Adventure.pdf http://file.allitebooks.com/20171108/Getting Started with Python and Raspberry Pi.pdf http://file.allitebooks.com/20171029/Python Machine Learning Case Studies.pdf http://file.allitebooks.com/20171009/Python for Data Analysis, 2nd Edition.pdf http://file.allitebooks.com/20171009/Programming with MicroPython.pdf http://file.allitebooks.com/20170831/Thoughtful Machine Learning with Python.pdf http://file.allitebooks.com/20170822/Test-Driven Development with Python, 2nd Edition.pdf http://file.allitebooks.com/20170813/Python Requests Essentials.pdf http://file.allitebooks.com/20170710/Effective Python Penetration

02
领券