This is the first time I've tried to integrate Python and HTML. I have mod_python installed on my Apache server, and I'm wondering if there's a specific way I should run a script, or if I should (can I?) put the code directly in the HTML.
What are the best ways of using Python through HTML?
解决方案
The best way is to set up a web framework that uses Python. Some good choices are Django, TurboGears, and Pyramid. While it is possible to do pure Python CGI or as an ISAPI extension, you don't really gain much from that approach, and a web framework is bound to be more efficient, understandable, and helpful.
Furthermore, web frameworks come with a philosophy and contain a lot of careful thought and best practices that you can learn from while you're working.