python嵌入html开发,在HTML中嵌入python

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值