I\'m thinking of switching from using PHP to Python for web applications, but I was wondering if Python is as adept as weaving in and out of HTML as PHP is. Essentially, I find
First of all: Escaping out into a programming language from HTML is nice when you do small hacks. For an actual production web application I would never to that.
Mixing in HTML into the programming language is unpractical. It's better to use some sort of templating language. Indentation is not an issue there in Python more than any other language.
But, to answer your actual question: It's the same. There are Python templating languages that allow you to escape out into Python as well, should you want to. I would rather recommend that you don't, but you can.