Python包-json

安装

1
pip install json

格式介绍

1
2
3
{"accesskeyID":"LTAI5tSRTFb****",
"accesskeysecret":"jAJGMov82****"
}

数据读取

1
2
3
4
5
6
7
8
9
#!/usr/bin/env python3
import json

with open('.aliyun.json') as f:
data = json.load(f)

# 获取值
data['accesskeyID'] # LTAI5tSRTFb****
data['accesskeysecret'] # jAJGMov82****
-------------本文结束感谢您的阅读-------------