並使用裡面的參數
先附上code:
jsonData.txt
------
{
"name":"wilson",
"no": 23,
"data":[ "aa","bb","cc"]
}
json讀取
------
import json
def main():
data = open('./jsonData.txt')
jdata = json.loads(data.read())
print(jdata['name'])
data.close()
if __name__ == "__main__":
main()
執行結果:
------
沒有留言:
張貼留言