```
import json

data1 = {'b': 789, 'c': 456, 'a': 123}

encode_line = json.dumps(data1)
decode_json = json.loads(encode_line)

print type(encode_line)
print type(decode_line)

```

The type(decode\_line) is [dict], but when we save data1 into an txt file, and read it using below script:

```
file = open('test.txt','r')
for line in file:
    encode_line = json.dumps(line)
    decode_line = json.loads(encode_line)

    print type(encode_line)
    print type(decode_line)

```

Now, the type(decode\_line) is [unicode]. why ?

I want to read data from txt file and then retrieve info from dict type. How should I do ?

Thanks!