Python Hypertext Preprocessor 0.92 review

by on

PyHP is a system to embed Python code in an HTML document in a way similar to how PHP works

License: GPL (GNU General Public License)
File size: 0K
Developer: Lethalman & Christopher A. Craig
0 stars award from

PyHP is a system to embed Python code in an HTML document in a way similar to how PHP works. PyHP allows use of the Python programming language in scripts similar to PHP. PyHP uses the Python 2.0 language to parse elements embedded in an HTML page.

When I started this, I was enamoured with PHP. I've since discovered that embedding code in HTML does not seem like the most logical way to do things. If someone wants to pick this up, email me. In the mean time, if you want a truely novel approach to web design with Python, check out the very cool Quixote framework.

THis is a small, fast, hypertext preprocessor that used the world's greatest scripting language, Python, as its base. There was another program out there that did this, PMZ, but I quickly found what I believed to be shortcomings in it.

Namespace polution
My main problem with PMZ is that it does not execute its programs in a seperate name space. If you define a variable name 'fields' in the global namespace then PMZ will crap out because there is a variable of that name that is of vital importance to the interpreter itself. I did not find this to be acceptable, and Python 2.0's InteractiveInterpreter class made it easy to get around this in PyHP.
PyHP was designed for use with Apache's mod_python. It will run just fine as a standalone program, but it has been designed to be accelerated under mod_python by automatically caching modules that have been imported and supporting the manual caching of variables as well
Header specification
PMZ has a fixed set of headers that cannot be modified by a PMZ script. PyHP allows script writers to specify what headers are attached to their documents, even to do so in the middle of the HTML file.

What's New in This Release:
Fixed a critical bug caused by the previous changes
Added better documentation
Tested before releasing

Python Hypertext Preprocessor 0.92 search tags