完整脚本:
import pprint
def application(environ, start_response):
start_response('200 OK', [('content-type', 'text/html')])
aaa = ['a','b','c']
pprint.pprint(aaa)
Run Code Online (Sandbox Code Playgroud)
如果我要在终端上运行它,那就是......
>>> import pprint
>>> aaa = ['a','b','c']
>>> pprint.pprint(aaa)
['a', 'b', 'c']
>>>
Run Code Online (Sandbox Code Playgroud)
你可以看到它工作正常.但是通过wsgi-script它不起作用.
error_log中:
TypeError:'NoneType'对象不可迭代
BTW是"pprint"PHP中的"print_r()"等价?