python html generator

前端 未结 9 1603
轮回少年
轮回少年 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 22:46

    If you want programmatic generation rather than templating, Karrigell's HTMLTags module is one possibility; it can include e.g. the class attribute (which would be a reserved word in Python) by the trick of uppercasing its initial, i.e., quoting the doc URL I just gave:

    Attributes with the same name as Python keywords (class, type) must be capitalized :

    print DIV('bar', Class="title")  ==>  
    bar

提交回复
热议问题