What Content-type is required to write Python CGI program?

If we run simple scripts like hello.py, its output is written on the STDOUT file, i.e., screen. 

There is one important and extra feature available which is the first line to be printed Content-type:text/html\r\n\r\n. This line is sent back to the browser and it specifies the content type to be displayed on the browser screen.

We can write advanced CGI programs using Python. This script can interact with any other external system and even exchange information with RDBMS.

Updated on: 30-Jul-2019


Kickstart Your Career

Get certified by completing the course

Get Started