python NameError: name 'false' is not defined


执行这行代码会报错,NameError: name 'false' is not defined

 response_content =  {"result":false,"returnCode":"500","message":"失败"}

你可以使用下面这两行代码来解决:

 false = False
 response_content =  {"result":false,"returnCode":"500","message":"失败"}

参考:https://www.e-learn.cn/content/wangluowenzhang/666425
https://stackoverflow.com/questions/28843876/nulls-instead-of-nones-in-json-data-with-python/28843950#28843950


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2024 CODEPRJ.COM