'module' object has no attribute 'loads' while parsing JSON using python
- 阅读更多 关于 'module' object has no attribute 'loads' while parsing JSON using python
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to parse JSON from Python. I recently started working with Python so I followed some stackoverflow tutorial how to parse JSON using Python and I came up with below code - #!/usr/bin/python import json j = json.loads('{"script":"#!/bin/bash echo Hello World"}') print j['script'] But whenever I run the above code, I always get this error - Traceback (most recent call last): File "json.py", line 2, in import json File "/cygdrive/c/ZookPython/json.py", line 4, in j = json.loads('{"script":"#!/bin/bash echo Hello World"}')