How to send response code from python using cgi package
<p>I am writing a script in python using cgi package. I need to send response of either <strong>HTTP/1.1 200 OK\n</strong>    or    <strong>HTTP/1.1 404 Not Found\n</strong>    based on some checks in my code. If I print one of the above line as the first line of my response my apache server logs an error and returns     <strong>500 Internal server error</strong>    The relevant part of the error message logged in this case is     <strong>malformed header from script 'helo.py': Bad header: HTTP/1.1 200 OK\n</strong>         Can anyone guide me what am I doing wrong here.</p>