Browse Source

fix name removed old file

master
Elray02 3 years ago
parent
commit
297ea3be66
2 changed files with 17 additions and 18 deletions
  1. +0
    -18
      readerFromJSON.py
  2. +17
    -0
      reader_from_JSON.py

+ 0
- 18
readerFromJSON.py View File

@@ -1,18 +0,0 @@
import json
from random import choice
from sys import argv
from collections import OrderedDict

def generateFromJson(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(generateFromJson(argv[1]))
else:
print('Usage:', argv[0], 'something_antani.json')

+ 17
- 0
reader_from_JSON.py View File

@@ -0,0 +1,17 @@
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(generate_from_json(argv[1]))
else:
print('Usage:', argv[0], 'something_antani.json')

Loading…
Cancel
Save