File size: 302 Bytes
6732cea
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import json
import base64
import os

with open('screenshot.png', 'r') as f:
    data = json.load(f)
    if 'image_base64' in data:
        with open('real_screenshot.png', 'wb') as img_file:
            img_file.write(base64.b64decode(data['image_base64']))
    else:
        print("Format inattendu")