擅长:python、mysql、java
<p>在脚本开头添加以下内容:</p>
<pre><code>#!/usr/bin/env python
print 'Content-Type: text/html'
print
</code></pre>
<p>我总是在python cgi脚本中声明<code>Content-Type</code>,这是有礼貌的。在</p>
^{pr2}$
<p>如果脚本出现错误,例如引发任何异常,<a href="http://docs.python.org/library/cgitb.html" rel="nofollow">^{<cd2>}</a>将向您显示一个很好的基于web的回溯。在</p>