Skip to content

Commit ba8dc95

Browse files
author
Matt Morrison
committed
added some comments
1 parent bd71e19 commit ba8dc95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_unicode.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
# script to generate variable-length random "words" consisting of Unicode codepoints.
2+
#
13
from ast import literal_eval
24
from datetime import datetime as dt
35
import random
46

7+
# TODO: use argparse to pass word number and length via command line
8+
59
with open("ID_Start.txt") as start, open("ID_Continue.txt") as cont:
610
starters = [word.strip() for word in start.readlines()]
711
continuers = [word.strip() for word in cont.readlines()]
812

913
allchars = starters + continuers
10-
word_num = 50
14+
word_num = 50 # how many words to write to test file
1115
timestamp = dt.now().strftime("%Y.%m.%d.%H.%M.%S")
1216
with open("output." + timestamp + ".py", "w") as output:
1317
for i in range(word_num):
14-
length = random.randint(1, 10)
18+
length = random.randint(1, 10) # length of word, between 1 and 10
19+
# make 10 a variable?
1520
word = literal_eval(random.choice(starters))
1621
for j in range(length):
1722
if len(word) == j:

0 commit comments

Comments
 (0)