TypeError: 'unicode' object is not callable

来源:转载

今天在使用wechatpy编写调用公众号的网页登录授权的时候,获取授权登录地址时,使用了实例化对象,直接调用方法,结果就报这错误。


Traceback (most recent call last):
File "C:/Python27/lib/site-packages/flask/app.py", line 1994, in __call__
return self.wsgi_app(environ, start_response)
File "C:/Python27/lib/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "C:/Python27/lib/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:/Python27/lib/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "C:/Python27/lib/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:/Python27/lib/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:/Python27/lib/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "C:/Python27/lib/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "E:/lightboat/ZhanLu/zhanlu/v0_1/login/api.py", line 41, in home
qrurl = wxpay_api.qrconnect_url()
TypeError: 'unicode' object is not callable

后来仔细研究发现,qrconnect_url 是个属性,不是方法,所以就报这错了,不能将字符串当做方法用!!!

分享给朋友:
您可能感兴趣的文章:
随机阅读: