-
-
Save amcgregor/4a622ec32d1fed5c3bccb986f75b4549 to your computer and use it in GitHub Desktop.
Reference https://github.com/amcgregor/python-samples/blob/main/Metaprogramming/Alternate%20Class%20Instantiation.ipynb "the punchline" and "making it importable" sections for what `html.tag` is.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from html import tag as H | |
def app(environ, start_response): | |
start_response('200 OK', []) | |
page = H.html [ | |
H.title("Transvoice App"), # I use double quotes for human text, single for machine. | |
H.style("…"), | |
H.article(data_layout='twin') [ | |
H.header [ H.h3 [ "Main Language" ] ], | |
H.textarea('Main Language', rows=6, maxlength=5000), # actual attribute name, not max_chars | |
] | |
] | |
return [str(page)] | |
# yield from page # isn't implemented yet, but. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment