Python 为什么在很多CGI脚本中需要一个空的echo/print行?
为什么在很多CGI脚本中需要一个空的echo/print行 bash示例:Python 为什么在很多CGI脚本中需要一个空的echo/print行?,python,bash,Python,Bash,为什么在很多CGI脚本中需要一个空的echo/print行 bash示例: #!/bin/bash echo "Content-type: text/html" echo '' echo 'CGI Bash Example' python示例: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain
#!/bin/bash
echo "Content-type: text/html"
echo ''
echo 'CGI Bash Example'
python示例:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# enable debugging
import cgitb
cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print
print "Hello World!"
我不认为您的具体示例没有描述
echo''
的使用(如果有)。当我在中删除该行时,会出现500内部服务器错误。我使用Apache。请参阅本页标题为“通用格式”的部分