I''m hoping someone can give me the basics for how to do very simple
things with Python scripts from within my HTML. For example, I know that
I can do this in PHP:
Here is a header
<?php include("file.html"); ?> // include some external html
More html
So to do this with Python, do I simply integrate it into the HTML as
above, with no extra steps? Also, which symbols do I use to denote
Python language?
Thanks.
解决方案John Salerno wrote:I''m hoping someone can give me the basics for how to do very simple
things with Python scripts from within my HTML. For example, I know that
I can do this in PHP:
Here is a header
<?php include("file.html"); ?> // include some external html
More html
So to do this with Python, do I simply integrate it into the HTML as
above, with no extra steps? Also, which symbols do I use to denote
Python language?
Thanks.
Also, do I need to give the html file an extension of .py?
John Salerno:
[Python alternative for PHP]So to do this with Python, do I simply integrate it into the HTML as
above, with no extra steps?
You''d need something like the PHP engine, that understands Python rather
than PHP.
I''ve used Cheetah:
http://www.cheetahtemplate.org/
Our BDFL seems to prefer Django:
http://www.artima.com/weblogs/viewpo...?thread=146606
There''s also PSP:
http://www.ciobriefings.com/psp/
And many more:
http://wiki.python.org/moin/WebProgramming
--
René Pijlman
Rene Pijlman wrote:John Salerno:
[Python alternative for PHP]So to do this with Python, do I simply integrate it into the HTML as
above, with no extra steps?
You''d need something like the PHP engine, that understands Python rather
than PHP.
My web server can run Python, fortunately. Now that they''ve turned it on
for me, I wanted to try it out, but I didn''t know how to go about
writing a bit of code to stick into an HTML file.