Skip to content

Commit a77cb15

Browse files
authored
Merge pull request dwyl#153 from fbattello/script-pythonic
In create_json.py replaced the loop with a dict compreh…
2 parents 60eb05a + cfa34e4 commit a77cb15

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/create_json.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333

3434
words = open(sys.argv[1])
3535
word_list = words.readlines()
36-
json_words = {}
37-
for count in range(len(word_list)):
38-
json_words[word_list[count].rstrip()] = '1'
36+
json_words = {word.rstrip(): "1" for word in word_list}
3937

4038
print(json.dumps(json_words, indent=4))

0 commit comments

Comments
 (0)