show toefl word

This commit is contained in:
hillerliao
2020-06-24 15:35:24 +08:00
parent bf14280a80
commit 34157d7f0e
6 changed files with 2682 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
import random
import linecache
import sys
from os import path
file_path = path.dirname(path.realpath(__file__))
def ctx():
file = path.join(file_path,'toeflwords.txt')
with open(file, encoding='utf-8') as inf:
f = inf.readlines()
count = len(f)
wordnum = random.randrange(0, count, 1)
word = linecache.getline(file, wordnum)
return {"word": word}