How nicely does Python 'flow' with HTML as compared to PHP?

后端 未结 5 1924
臣服心动
臣服心动 2021-02-08 02:51

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

5条回答
  •  一生所求
    2021-02-08 03:25

    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.

提交回复
热议问题