this is a simple script that read a json file and compose from that a prase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
483 B

import json
from random import choice
from sys import argv
from collections import OrderedDict
def generate_from_json(text):
with open(text) as data_file:
out_list = []
data = json.load(data_file, object_pairs_hook=OrderedDict)
out_string = " ".join(choice(data[keys])for keys in data)
return out_string
if __name__ == '__main__':
if argv[1:]:
print('Usage:', argv[0], 'something_antani.json')