Skip to content
Rubarion edited this page Oct 27, 2024 · 4 revisions

Welcome to the py4html documentation or tutorial


As of October 24th 2024, the work on the initial version of py4html is nearly completed and so the first fully functional version of this Python web framework has already been made available to the Python Package Index-PyPi So you can now easily install this Python easy web dev framework using pip


Installation

pip install py4html


A simple usage example


Python code

from py4html import *

heading("sreehari and his sruthi",1)

division_begins("first",{"width":"33%","float":"left","background-color":"#FFF4A3"})

heading("Kerala",2)

paragraph("kerala is in India")

paragraph("kerala lies in south")

division_ends()


division_begins("second",{"width":"33%","float":"left","background-color":"#FFC0C7"})

heading("Northern Districts of Kerala",1)

ordered_list("kannur","kozhikode","wayanad")

division_ends()


division_begins("third",{"width":"33%","float":"left","background-color":"#D9EEE1"})

heading("Some states in India")

unordered_list("Gujarath","Rajasthan","Haryana")


division_ends()

Equivalent HTML code generated by py4html

<!DOCTYPE html>
<html>
<style>
</style>
<body>
<h1>
sreehari and his sruthi
</h1>
<div class ="first"  style="width:33%; float:left; background-color:#FFF4A3; ">
<h2>
Kerala
</h2>
<p>
kerala is in India
</p>
<p>
kerala lies in south
</p>
</div>
<div class ="second"  style="width:33%; float:left; background-color:#FFC0C7; ">
<h1>
Northern Districts of Kerala
</h1>
<ol>
<li>kannur</li>
<li>kozhikode</li>
<li>wayanad</li>
</ol>
</div>
<div class ="third"  style="width:33%; float:left; background-color:#D9EEE1; ">
<h1>
Some states in India
</h1>
<ul>
<li>Gujarath</li>
<li>Rajasthan</li>
<li>Haryana</li>
</ul>
</div>
</body>
</html>

Web Page Generated

one

Clone this wiki locally