- instal pitsu:
pip3 install pitsu
or
pip install pitsu
simple example:
from pitsu import *
html(
head(
meta(charset="UTF-8"),
title("Example Login")
),
body(
form(
inp( # inp = input element
type="text",
name="user",
id="user",
required=""
class_="User Name"
),
br(),
inp(
type="password",
name="pass",
id="pass",
required=""
class_="User Pass"
),
br(),
inp(
type="submit",
value="Submit"
),
action="/",
method="get"
)
),
lang="en"
)
you can use the method pack to pack your html page:
page = html(
...
)
pack(page)
output:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>
Example Login
</title>
</head>
<body>
<form action="/" method="get">
<input type="text" name="user" id="user" required />
<br>
<input type="password" name="pass" id="pass" required />
<br>
<input type="submit" value="Submit" />
</form>
</body>
</html>
see Documentation