本文介绍了在HTML中嵌入python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人可以通过我的HTML中的Python脚本向我介绍如何使用Python脚本完成非常简单的事务。例如,我知道

我可以用PHP做到这一点:


< h1>这是一个标题< / h1>

<?php include(" file.html"); ?> //包含一些外部html

< p>更多html< / p>


所以要用Python做这个,我只需将它集成到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:

<h1>Here is a header</h1>
<?php include("file.html"); ?> // include some external html
<p>More html</p>

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.

推荐答案




此外,我是否需要给出html文件扩展名为.py?



Also, do I need to give the html file an extension of .py?





你需要像PHP这样的东西引擎,比PHP理解Python而不是



我用过猎豹:



我们的BDFL似乎更喜欢Django:



还有PSP:



还有更多:



-
$ b $bRenéPijlman



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




你需要的东西就像PHP引擎一样,比PHP更理解Python。



You''d need something like the PHP engine, that understands Python rather
than PHP.




幸运的是,我的Web服务器可以运行Python。既然他们已经把它打开了我的b $ b,我想尝试一下,但我不知道怎么去

写一点代码粘贴到HTML文件中。



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.


这篇关于在HTML中嵌入python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:01
查看更多