python NameError: name 'false' is not defined

This line of code will execute an error, NameError: name 'false' is not defined

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

You can use the following two lines of code to solve:

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

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

Guess you like

Origin www.cnblogs.com/wanthune/p/11752762.html
Recommended