0
TypeError at /python_tutor
'instancemethod' object is not subscriptable

当我在在线 python 导师脚本中运行此脚本时:

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.get["user_script",none]
        exec mycode

/python_tutor name 'none' 处的 NameError 未定义

4

1 回答 1

4

尝试更改noneNone. 资本化问题。此外,看起来应该有圆括号而不是方括号get

于 2012-05-24T09:40:52.550 回答