Python json import 'module' object has no 'load' attributes

I am using PyScripter for Windows with Python 2.7.3 and I am trying to import json. This seems to work if I use the interpreter directly, but when saved to a file and run, I get a "module" object that has no "load" attributes.

import json j = '{"one": 1, "numbers": [1, 2, 3.5]}' x = json.loads(j) 

Interpreter for returning x, {u'numbers': [1, 2, 3.5], u'one': 1}

I'm new to Python, so I'm sorry if this is an idiotic question. Many thanks

+4
source share

Source: https://habr.com/ru/post/1414096/


All Articles