[Solved] How to compile and send result php code in python http server?


Your script is working as “intended”. Python will not magically parse and execute PHP code. You need a PHP interpreter for that.

You could of course write one in your python server if so inclined, but I would rather recommend you to take a look at either Python web development (if you want to roll your own server for educational purposes you may want to use an existing templating system like Jinja), or PHP development.

1

solved How to compile and send result php code in python http server?