fromlysimportLprint(L.body/(L.h1/'What is love ?',L.ul/(L.li/'Something in the air',L.li/'You can\'t catch it',L.li/(L.a(href="https://en.wikipedia.org/wiki/Love")/'Keep trying'),),))
To install, pip3 install lys
A few more tricks:
# raw() to mark the content as already escapedfromlysimportrawL.p/raw('<script>alert("boo")</script>')# attributes '_' are replaced with '-'L.button(data_id="123")/'click me'# => <button data-id="123">click me</button># shortcut to add classes and ids easilyL.button('#magic-button.very-big',onclick='add_it()')/'Magic !'# one easy way to do loops and ifs(L.h1/'Welcome',(L.ul/('Try one of our recipes:',(L.li/(L.a(href=recipe.link)/recipe.name)forrecipeinrecipes))iflen(recipes)>0else''),)