Syntax for class keyword in HTMLgen

sgtpepper google at
Sun Feb 23 01:16:59 CET 2003

Duncan Booth <duncan at> wrote in message news:<Xns93295BFCBC0Fduncanrcpcouk at>...
> google at (sgtpepper) wrote in 
> news:88e6fe6b.0302202200.6f84c81e at
> > I get 'Syntax error:  invalid syntax' with the error 'pointer'
> > pointing to the 'c' in 'class' since it is a reserved keyword.
> > 
> > Any ideas?
> I haven't used HTMLgen myself, but a quick look at the code seems to 
> indicate that it lowercases all the attribute names. Since the 'lets make 
> Python case insensitive' movement haven't yet won the day, you could try:
>    div = Div( align="left", CLASS="myclass" )
> or any mixed casing that appeals.

HTMLgen does indeed downcase the HTML attribute keywords, so using
CLASS did the trick.  Thanks to all!

More information about the Python-list mailing list