def print_result_for_plain_cgi_script(contenttype: str,
                                      headers: TYPE_WSGI_RESPONSE_HEADERS,
                                      content: bytes,
                                      status: str = '200 OK') -> None:
    """
    Writes HTTP request result to stdout.
    """
    headers = [
        ("Status", status),
        ("Content-Type", contenttype),
        ("Content-Length", str(len(content))),
    ] + headers
    sys.stdout.write("\n".join([h[0] + ": " + h[1] for h in headers]) + "\n\n")
    sys.stdout.write(content)
Writes HTTP request result to stdout.