Embed Python in HTML?

S

Sean Hammond

Forgive my ignorance, but I sometimes write custom dynamic web-pages
using PHP, by simply embedding PHP in HTML with <?php ?> tags, and
renaming for example index.html to index.php and making it executable. I
only use this for very minor things like calling a script, and don't
really want to learn any more PHP as it looks awful. So I was wondering,
is it possible to throw together dynamic web pages like this using
Python or other languages? If so, can anyone point me to any relevant
tutorials, references or other info?

Thanks
 
R

Ramon Diaz-Uriarte

Forgive my ignorance, but I sometimes write custom dynamic web-pages
using PHP, by simply embedding PHP in HTML with <?php ?> tags, and
renaming for example index.html to index.php and making it executable. I
only use this for very minor things like calling a script, and don't
really want to learn any more PHP as it looks awful. So I was wondering,
is it possible to throw together dynamic web pages like this using
Python or other languages? If so, can anyone point me to any relevant
tutorials, references or other info?


Dear Sean,

You have _lots_ of choices. Many web frameworks provide exactly what
you want, and then some. And I guess what could make your choice
harder is deciding how much of that "some" you want.

I'd start going over:

http://wiki.python.org/moin/Templating

(or
http://wiki.python.org/moin/WebProgramming
for broader stuff).


Best,

R.
 
F

Fredrik Lundh

Sean said:
Forgive my ignorance, but I sometimes write custom dynamic web-pages
using PHP, by simply embedding PHP in HTML with <?php ?> tags, and
renaming for example index.html to index.php and making it executable. I
only use this for very minor things like calling a script, and don't
really want to learn any more PHP as it looks awful. So I was wondering,
is it possible to throw together dynamic web pages like this using
Python or other languages?

sure, and an endless number of programmers have provided their own
favourite way to do this:

http://wiki.python.org/moin/Templating
http://www.google.com/search?q=python+server+pages
http://www.google.com/search?q=python+template+languages

and so on. if you want to roll your own, see:

http://jtauber.com/2006/05/templates.html
http://blog.ianbicking.org/templating-via-dict-wrappers.html

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top