json import json with open('example.json', 'r') as file: data = json.load(file) with open('example.json', 'w') as file: json.dump(data, file) image from PIL import Image image_path='img.jpg' image = Image.open(image_path) # 可选:显示图片 image.show()