Pyh - A powerful python module to generate HTML code from a python script

  •        847

Code your webpage like a GUI! PyH allows you to simply generate HTML pages from within your python code in an object-oriented fashion. Each HTML tag is an object that can be modified at any time. The HTML tags are neatly output so that the sources of your HTML files are human-readable. Check the Wiki for documentation. File bug reports and feature requests at http://launchpad.net/pyh Get PyHDownload the latest version of pyh from the Download tab or directly from here PyH-0.1.1.tar.gz Quick exampleThe following python code snipet from pyh import *page = PyH('My wonderful PyH page')page.addCSS('myStylesheet1.css', 'myStylesheet2.css')page.addJS('myJavascript1.js', 'myJavascript2.js')page << h1('My big title', cl='center')page << div(cl='myCSSclass1 myCSSclass2', id='myDiv1') << p('I love PyH!', id='myP1')mydiv2 = page << div(id='myDiv2')mydiv2 << h2('A smaller title') + p('Followed by a paragraph.')page << div(id='myDiv3')page.myDiv3.attributes['cl'] = 'myCSSclass3'page.myDiv3 << p('Another paragraph')page.printOut()will generate the following html My wonderful PyH page

My big title

I love PyH!

A smaller title

Followed by a paragraph.

Another paragraph

PyH stands for any of the following : Pour yourself a ScotcH, Poor young Hobo or Peel your HTML. Any other suggestions?

http://code.google.com/p/pyh

Tags
Implementation
License
Platform

   




Related Projects

vim-olive - Vim Mode Line Verifier


Vim Mode Line Verifier

vim-mash - Motion Activated Search Highlighter for Vim


Motion Activated Search Highlighter for Vim

vim-grillz - Flash your wicked grillz!


Flash your wicked grillz!

vim-foist - Complete whole lines from any partial therein


Complete whole lines from any partial therein

vim-efmc - Vim Error Format Compiler


Vim Error Format Compiler


uzbl-utrs - mkng uzbl tlrbl


mkng uzbl tlrbl

toycsv - A toy CSV parser written in ruby + lexr + racc


A toy CSV parser written in ruby + lexr + racc

tiktok - TikTok provides a simple asynchronous timer object for VimL.


TikTok provides a simple asynchronous timer object for VimL.

tabby - Using Vim's Tabs the Right Way


Using Vim's Tabs the Right Way

SohiVila - GNU source-highlight Vim language


GNU source-highlight Vim language

SinTax - A DSL for generating Vim syntax highlighting files


A DSL for generating Vim syntax highlighting files

rkdots - Generate a graphviz visualisation of the given javascript statement.


Generate a graphviz visualisation of the given javascript statement.

RelNumBar - Show relativenumbers alongside normal numbers in Vim


Show relativenumbers alongside normal numbers in Vim

Punisher - Punisher hurts you where it hurts most - your time.


Punisher hurts you where it hurts most - your time.

noisy - Don't chat quietly (weechat channel noises)


Don't chat quietly (weechat channel noises)

newlisp-manual - Asciidoc version of the newLISP manual


Asciidoc version of the newLISP manual

Land-of-newLISP - Selected snippets from Land of Lisp rewritten in newLISP


Selected snippets from Land of Lisp rewritten in newLISP

Fossilise - Poor man's collaborative editing in Vim


Poor man's collaborative editing in Vim

firstly - Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers


Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.