473,382 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

HTMLgen docs, tutorial

Checking out HTMLgen, I find the manual
to be quite terse, and difficult to crack.

Are there any examples or tutorials available
for this package?

Thanks,

Tobiah

Jul 18 '05 #1
4 2844
us**@domain.invalid wrote:
Checking out HTMLgen, I find the manual
to be quite terse, and difficult to crack.

Are there any examples or tutorials available
for this package?


Its quite easy: if you have a HTML-tag with included text,
just use the approriate class and pass the text as argument:

<p>hallo</p> becomes Para("hallo")

Headers take an additional argument, the level:

<h1>Head</h1> becomes H(1,"Head")

Nested tags are the same es nested function calls. Each tag
is a container and has an append()-method:

p = Para("hallo")
p.append("another hallo")

Each tag-class ctor takes keyword arguments which become
tag arguments:

l = OrderedList(type='i')

creates an <ol type='i'> like list.

For further info look at the sources, esp. at the HTMLtest
module.

Mathias
Jul 18 '05 #2

Its quite easy:


Thanks,

That helps quite a bit.

Then there are the document classes. Does one normally
just append element classes to a document and then ask
the document to print itself?

Thanks,

Tobiah

Jul 18 '05 #3
us**@domain.invalid wrote:

Its quite easy:

Thanks,

That helps quite a bit.

Then there are the document classes. Does one normally
just append element classes to a document and then ask
the document to print itself?

Thanks,

Tobiah

I have stripped one of my scripts to a more or less minimal example below:

doc = SimpleDocument(title"pageTitle")
doc.meta = Meta(name="keywords",content="Keywords")
row = TR()
row.append(TD("text")),valign="TOP",bgcolor="#FFFF FF"),"\n")
doc.append(TableLite(row))
doc.write("name.html"))

kind regards Gerrit
--
Gaudi systems architecting:
http://www.extra.research.philips.com/natlab/sysarch/

Jul 18 '05 #4
us**@domain.invalid wrote:
Checking out HTMLgen, I find the manual
to be quite terse, and difficult to crack.

Are there any examples or tutorials available
for this package?

Thanks,

Tobiah


Unfortunately, that's all there is with the exception of a very small
section in the O'Reilly book, "Python Programming".
What I would like to know is, is HTMLgen still actively maintained. The
reason I ask is because I have added quite a bit of new stuff and I would
like to have my addition included in the main distro. I have tried emailing
the author but I have not receive a reply.
If anybody would be interested I could make my mods available of download
from my web site at http://www.rygannon.com or http://www.totalrekall.co.uk

--
Best Regards
John
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dont bother | last post by:
Hi, I have downloaded the HTMLgen for generating web pages with python. However I untared and unzipped it. I tried to link it with my path like this: Heres my .bashrc file...
1
by: Andre van der Vlies | last post by:
Hi, I've made some (minor) adjustments to HTMLgen. I added a 'style' option for (form)buttons and a 'valign' option for table(cells).... I tried to send this to the author of HTMLgen but e-mail...
2
by: adeger | last post by:
For use of CSS how do I do something like insert a 'class' attribute into an HTML tag like: <TABLE class='standard'></TABLE> I've really made a good faith effort to find this in the...
0
by: Armand Federico - INFO | last post by:
I received an error when i try htmlgen on winxp, apapche, mysql, mod_python THIS IS THE ERROR Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File...
0
by: C. Titus Brown | last post by:
Hi all, I spent a little bit of time today working on Robin Friedrich's HTMLgen, and made it work more like a modern Python package, with a Python package directory & distutils-based setup.py. ...
5
by: Cappy2112 | last post by:
Does anyone know if the table align property is available in HTMLgen.Table? The docs don't show it, but I find it hard to believe that it is not available. I want to center the table. Only the...
4
by: kgmuller | last post by:
Does anybody know whether htmlGen, the Python-class library for generating HTML, is still being maintained? Or from where it can be downloaded? The Starship site where it used to be hosted is dead....
4
by: Joshua J. Kugler | last post by:
I realize that in today's MVC-everything world, the mere mention of generating HTML in the script is near heresy, but for now, it's what I ened to do. :) That said, can someone recommend a good...
5
by: econtreras.bantech | last post by:
Good day Mr. Guido, excuse my poor english. I am looking for HTMLgen module but not to find this, the link referenced in www.python.org it does not exist. I have need to develop in cgi and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.