In create_json.py replaced the loop with a more pythonic dict comprehension
This commit is contained in:
parent
60eb05a128
commit
cfa34e4c14
@ -33,8 +33,6 @@ import json
|
||||
|
||||
words = open(sys.argv[1])
|
||||
word_list = words.readlines()
|
||||
json_words = {}
|
||||
for count in range(len(word_list)):
|
||||
json_words[word_list[count].rstrip()] = '1'
|
||||
json_words = {word.rstrip(): "1" for word in word_list}
|
||||
|
||||
print(json.dumps(json_words, indent=4))
|
||||
|
Loading…
x
Reference in New Issue
Block a user