我在 python 中遇到了关键错误。
像这样的错误............
KeyError at /python_tutor/
'user_script'
这个代码是
import web_exec
def tutor(request):
print "Inisde tutor", request.method
print "POST =", request.POST
if request.method == "POST" :
print "Inside Post"
print "My Script =", request.POST["user_script"]
mycode = request.POST["user_script"]
exec mycode
web_exec('mycode')
请给我解决方案?