Python JSON Parse
Parse JSON - JSON မှ Python သို့ ပြောင်းပါ။
သင့်တွင် JSON စာကြောင်းတစ်ခုရှိပါက၊ ၎င်းကို
json.loads()
နည်းလမ်းဖြင့် ခွဲခြမ်းစိတ်ဖြာနိုင်သည်။
ရလဒ်သည် Python အဘိဓါန် ဖြစ်လိမ့်မည် ။
ဥပမာ
JSON မှ Python သို့ ပြောင်းပါ
import json
# some JSON:
x = '{ "name":"John", "age":30, "city":"New
York"}'
# parse x:
y = json.loads(x)
# the result is a
Python dictionary:
print(y["age"])