Python scripts in HTML

PHP doesn't run in the browser, as it is a server side language. You could try Skulpt to try to run python in the browser.


Python indentation requirements don't go well with mixing HTML and Python code. Therefore, the most prominent method (which is a framework called Django), uses a template engine so that the Python is never in direct contact with the HTML code.

It will be similar to PHP and not javascript, as it will run on the server-side.

There is also mod_python for Apache, but I would strongly recommend using Django, which also runs on an Apache server.

Tags:

Python

Html