[Tutor] PHP
wesley chun
wescpy at gmail.com
Sat Dec 4 21:38:00 CET 2010
> Straightaway, i was impressed by one powerful property; the ability to
> imbed php into a html webpage, and switch into and out of php as needed,
> and let normal ssi and html and css work the rest of the time, outside
> of php. all I have to do is start the php block with
> <?php # start the php block of code
> write code;
> ?> # end the php block
> and continue in html. What a BLOODY shame we can't do that in python,
> which is otherwise awesome and superior in every way i can thus far evaluate.
sure you can! however you have to use a web templating system, and
there are many in Python (Mako, Genshi, Myghty, Kid, Cheetah, Jinja,
Django templates, etc.). some examples here:
Mako:
http://www.makotemplates.org/docs/syntax.html#python-blocks
Genshi:
http://genshi.edgewall.org/wiki/Documentation/templates.html
Myghty:
http://www.myghty.org/docs/embedding.html
it is not built-in to the language because Python is more
general-purpose, so you have to import those packages to use them.
hope this helps!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
http://corepython.com
wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com
More information about the Tutor
mailing list