Skip to main content

Simple Python Website Frame work

Project description

vweb is a simple Python Website Frame work.

It is Python CGI, but can be used with Cherrypy. It is not MVC.

* htmlpage - Is a website page which processes cgi parameters.

You subclass it and override

- process() for handling incoming parameters, and
- getHtmlContent() to display the page.

* html - Is an html abstraction layer

b('hi')
p(font('some text', color='green'))
a('Chapter 2', href='chapter2.html')

Returns these string:

<b>hi</b>
<p><font color='red'>text</font></p>
<a href='chapter2.html'>Chapter 2</a>

* htmltable - Is an html table abstraction layer
Inspired by perl's HTML:Table

from htmltable import HtmlTable

table = HtmlTable()
table.addHeader(['No.', 'President'])
table.addRow([1, 'George Washington'])
table.setColAlign(2, 'right')
print table.getTable()

Returns:

<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>No.</th>
<th align="right">President</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td align="right">George Washington</td>
</tr>
</tbody>
</table>


* examples(n).py - Examples of how to use the code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vweb-1.0.tar.gz (7.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page