1
0

file i/o: use 'with' keyword

This commit is contained in:
SomberNight
2017-11-12 14:33:46 +01:00
parent 8fcf1656d3
commit c65d01ea96
8 changed files with 22 additions and 20 deletions

View File

@@ -98,7 +98,8 @@ def normalize_text(seed):
def load_wordlist(filename):
path = os.path.join(os.path.dirname(__file__), 'wordlist', filename)
s = open(path,'r').read().strip()
with open(path, 'r') as f:
s = f.read().strip()
s = unicodedata.normalize('NFKD', s)
lines = s.split('\n')
wordlist = []