An open API service indexing awesome lists of open source software.

https://github.com/dharmit/pyhtml

Generate html using Python
https://github.com/dharmit/pyhtml

Last synced: about 1 year ago
JSON representation

Generate html using Python

Awesome Lists containing this project

README

          

pyHtml
======

This module is used to generate html using Python. Currently there is very
limited functionlaity being provided by this module. The functionality
implemented so far can be summed up as :

* Creating an instance of the class will automatically create a file on the
disk with the name passed to the pyhtml() function. If no name is passed,
file with the name "My Web Page" will be created. Planning to make the
filename compulsory because if the user doesn't pass any value to pyHtml()
function for two instances, the resultant "My Web Page" file becomse a mess.

* The functions implemented are

- html : This is called by the __init__ method. It initializes
the tags that are almost always used in an html page.
- external_css : Lets you provide an external CSS file to the html page.
- internal_css : Lets you create custom CSS for the html page.
- a : Lets you create an anchor tag.
- hr : Lets you generate a horizontal ruler bar.
- br : Inserts a single line break in the html file.
- comment : Lets you add a comment to an html page.
- printOut : Lets you print the resulting html file.

* Usage : Import the pyHtml module in a script and use it as per the
documenation.

A lot of improvements need to be made to the code yet. Areas of improvement :

* Instead of using mmap each time a function is called and seeking to the
position where we want to insert, we can create a variable called say, insert,
and keep a track of the position. This should speed up the operation.