I am using windows 7, python3 and WAMP2.2.
Struggling to make my localhost display Python files. For the purpose of installing, I want to run in my browser the following python file:
print ("Content-type:text/html\r\n\r\n")
print ("<html>")
print ("<head>")
print ("</head>")
print ("<body>")
print ("<h2> Hello world </h2>")
print ("</body>")
print ("</html>")
1) I have tried to run python -m http.server
, but when I open the python file with the browser, the browser prints its content instead of shown the HTML.
2) I have installed the python support to my WAMP, exactly as described in the 1-st answer here: How to install Python with Wampserver , but I keep getting the same problem - the content of the file is displayed in the browser, instead of displaying the HTML.
How can I fix it?
Thanks