a python module to create html pages with python code
Project description
how to use
- 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=NO_VALUE
),
br(),
inp(
type="password",
name="pass",
id="pass",
required=NO_VALUE
),
br(),
inp(
type="submit",
value="Submit"
),
action="/",
method="get"
)
),
lang="en"
).pack()
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pitsu-2.0.0.tar.gz
(6.3 kB
view details)
File details
Details for the file pitsu-2.0.0.tar.gz.
File metadata
- Download URL: pitsu-2.0.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9eddc08ac71d8e4113cb6b2e392d7d0988e7698d6a9c5b5d839d2cabc08333f
|
|
| MD5 |
b2035dee320362c25d1d89da8cf49272
|
|
| BLAKE2b-256 |
603a30ccfc98a732839dc580204194f78ecbb8bd78bc4ea19846ac9d3a421ea6
|