Dynamic HTML controls

Alan Harris-Reid aharrisreid at googlemail.com
Tue Jan 12 08:53:58 EST 2010


alex23 wrote:
> On Jan 12, 1:26 pm, Alan Harris-Reid <aharrisr... at googlemail.com>
> wrote:
>   
>> Does anyone know where I can find any decent dynamically-constructed
>> HTML control classes (dropdown list, table, input field, checkbox, etc.)
>> written in Python.
>>     
>
> There's pyWeb[1], which seems pretty close to what you're asking for:
>
>   mytable =able(align='center', cellspacing=0, cellpadding=3,
> border=
>   mytable.add(tr(td("first row"), td("second row")))
>
> While it might be a little heavier than what you're after, you should
> also be able to do this with ToscaWidgets[2]. You'd probably have to
> make basic widgets for the general HTML controls, but that would give
> you a good head-start on writing your own, more complex widgets.
> Widgets can be a compilation of Python, HTML, CSS & JS. (I used this
> fairly extensively when it used to be called TurboWidgets)
>
> If you want to roll your own from scratch, I'm a big fan of the html
> [3] library:
>
>   >>> from html import HTML
>   >>> h =TML()
>   >>> with h.table(border=', width='987'):
>   ...   with h.tr:
>   ...     for header in ['column 1', 'column 2']:
>   ...       h.th(header)
>   ...
>   >>> print h
>   <table width=87" border="1">
>   <tr><th>column 1</th><th>column 2</th></tr>
>   </table>
>
> 1: http://www.freenet.org.nz/python/pyweb
> 2: http://toscawidgets.org
> 3: http://pypi.python.org/pypi/html/1.7
Hi Alex (I'm assuming that is your name from your nickname)

Thanks for the reply - I'll check-out all 3 solutions you suggest and 
I'm sure I'll find something near to what I am looking for.

Regards,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100112/68aa09d8/attachment-0001.html>


More information about the Python-list mailing list