How to run CGI “hello world” with python http.server
I am using Windows 7 and Python 3.4.3. I would like to run this simple helloworld.py file in my browser: print('Content-Type: text/html') print( '<html>') print( '<head></head>') print( '<body>') print( '<h2>Hello World</h2>') print( '</body></html>') What I do is: 1) Go to command line C:\Python (where python is installed) 2) run: python -m http.server 3) Got to Firefox and type http://localhost:8000/hello.py However, instead of "Hello World", the browser just prints the content of the hello.py file. How can I fix it? From the http.server docs : CGIHTTPRequestHandler can be enabled in the