3 ms·
What would happen if you could put a <?python> tag with python code right in a page just like you do with the <?php> tag? Is this even theoretically possible?
by theycallmemorty 14y ago
What would happen if you could put a <?python> tag with python code right in a page just like you do with the <?php> tag? Is this even theoretically possible?
I feel like the biggest advantage PHP and classic ASP have is that there is a low barrier to get the most basic dynamic content working. If you're not a programmer, you don't need to understand a framework or a design pattern to get things going.
- slurgfest 14y agoThere's no reason you couldn't. It wouldn't be Python, but you could do it by defining a new file format to be parsed by the server (mod_whatever). The earliest Python web frameworks were obsessed with this kind of stunt and it gave rise to a profusion of templating engines, some of which look pretty much exactly like what you are discussing. I think what happened is that people tried it and found that the advantage is not that great, but the disadvantages are substantial for things significantly beyond "hello world".