我有一个由Blueshot托管的服务器。我一直在使用PHP从iPhone获取帖子变量......但是现在我必须使用python从iPhone获取帖子变量。我写了这样的事情如何在我的服务器上运行python脚本?
import cgi
import cgitb; cgitb.enable() # for troubleshooting
print "Content-type: text/html"
print
print """
<html>
<head><title>Sample CGI Script</title></head>
<body>
<h3> Sample CGI Script </h3>
"""
form = cgi.FieldStorage()
message = form.getvalue("message", "(no message)")
print """
<p>Previous message: %s</p>
<p>form
<form method="post" action="index.cgi">
<p>message: <input type="text" name="message"/></p>
</form>
</body>
</html>
""" % message
,并上传到我的服务器,但它不工作...如果我浏览网页那么它只是显示的源代码..我不知道要不要蟒蛇安装在我的服务器上(我相信Python可能会作为默认安装)..我如何检查是否可以在我的服务器上运行python,如果不是,我如何在我的服务器上运行python脚本?我想要做的就是从iPhone获取POST变量(我知道如何从iPhone发送变量)在此先感谢...
hashbang很重要,+1。我总是使用它,但不是每个人都这样做 – 2011-04-13 06:54:49