Load json data and json url in Python 3.3

preview_player
Показать описание
Load json data and json data url in Python 3.3 a little from Python 2.7
Here I gave two examples using Json data from an array and from url.

import json
data = [ { 'a':'A', 'b':(2, 4), 'c':3.0 } ]
print(data_string)
print(data_load)
print(data_load[0]['a'])
return:
[{"a": "A", "b": [2, 4], "c": 3.0}]
[{'a': 'A', 'c': 3.0, 'b': [2, 4]}]
A
Reference:
#past 30days M4.5 earthquake

import json

print(data)
print(data['type'])

More about this video:
Рекомендации по теме
Комментарии
Автор

This worked perfectly for me. Thanks.
The haters don't know what the fuck they're doing.

GloomDev
Автор

Thanks man, that was really helpful. Was trying to encode from binary to string for like an hour, until I found this vid!)

ИгорьТ-хм
Автор

Thank you Jiansen Lu I found this video very helpful.

nebe
Автор

It says "ImportError: No module named request". Thanks how helpful. Not. Also, when using code that we can copy and paste.. why not make it executable? Jeez

ahrendjan
Автор

its giving me forbiden 403 in my php file

xshionigs
welcome to shbcf.ru