Skip to content

a python module to create html pages with python code

License

Notifications You must be signed in to change notification settings

Filipi565/pitsu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=""
                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

About

a python module to create html pages with python code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages