Python X JSON

Sample:

config.json

{
    "version": "1.0"
}

loadJSON.py:

import json

with open('config.json', 'r') as jsonFile:
    val = jsonFile.read()
    config = json.loads(val);
    print config['version']

Result:

1.0

PIL

作者:sean

Sample

from PIL import Image

image = Image.open("file.png")
image.show()