python html generator

前端 未结 9 1604
轮回少年
轮回少年 2020-12-04 22:28

I am looking for an easily implemented html generator for python. I found this one

http://www.decalage.info/python/html

but there is no wa

9条回答
  •  旧时难觅i
    2020-12-04 22:49

    Dominate is an HTML generation library that lets you easily create tags. In dominate, python reserved words are prefixed with an underscore, so it would look like this:

    from dominate.tags import *
    t = div(table(_id="the_table"), _class="tbl")
    print(t)
    
    
    

    Disclaimer: I am the author of dominate

提交回复
热议问题