Answers for "Randomize the json file data in python"

0

Randomize the json file data in python

import json

#import json file
filter = "JSON file (*.json)|*.json|All Files (*.*)|*.*||"
filename = rs.OpenFileName("Open JSON File", filter)

#Read JSON data into the datastore variable
if filename:
    with open(filename, 'r') as f:
        datastore = json.load(f)
Random.choice(datastore)
Posted by: Guest on February-24-2022

Code answers related to "Randomize the json file data in python"

Browse Popular Code Answers by Language