对于调试,我想在Google App Engine中显示变量的类型。如何在Google应用引擎中显示对象的类型
在传统环境中,我会用"print type(x)"
来做到这一点。但在GAE中,我只是不知道为什么我不能使用self.response.out.write(str(type(x) ) )
在浏览器中回显它。我很困惑,因为我确实将<type 'type'>
转换为< type 'str' >
。 由于这不起作用,我必须使用self.response.out.write(str(type(x) == type("123") ))
而不是直接回显类型。
那么我在思考中错过了什么?
我也使用日志记录模块来回应这种效果很好的类型。但我仍然想知道为什么self.response.out.write()
不起作用。
谢谢大家的帮助!
'self.response.out.write(str(type(x)))'显示给你什么? – 2012-03-26 12:28:48
什么都没有。令我困惑的是,操作没有任何回应,就像str()生成一个“”字符串 – boomplee 2012-03-26 17:30:14