How to make 'Content-type: text/html' not to be displayed in output?

谁都会走 提交于 2020-12-15 06:02:51

问题


I have a cgi python script which gets data from html form, handles it and makes a table which put to html code.

The snip of the code:

# -*- coding: utf-8 -*-
import cgi

print('Content-type: text/html\n')
print()
print("""<!DOCTYPE HTML>
        <html>
        # and etc.

When I use the form I see the new page with a table but before this table I see the text string

Content-type: text/html\

How to change the python code for not displaying this string in browser. Put it in comment doesn't help.

来源:https://stackoverflow.com/questions/64888172/how-to-make-content-type-text-html-not-to-be-displayed-in-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!