Is it possible to write Python scripts in HTML code similarly as you write PHP between <?php ... ?> tags?
I'd like to achieve that my Python application will run in the browser.
thank you for help
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.
A newer answer for an older question: There is a Python framework called Karrigell that
supports what it calls "Python Inside HTML". It interprets Python from HTML files with a ".pih" extension.
I've not tried Karrigell, but it looks compelling.
Well, this might be overkill, but you can install a localhost xampp server. Then, just put the right comments at the top of the file to direct xampp to the interpreter, and you can print out html or regular words right from the language itself. For example, a Python script like this
#!/Python34/python
print "Content-type: text/html"
print
print "Hello World"
Would give a webpage saying Hello World