Xinqi Bao's Git
5 workPath
= "../wordscapes/"
6 dictPath
= workPath
+ "dict/"
8 if __name__
== "__main__":
10 file_names
= subprocess
.Popen("ls " + dictPath
, shell
=True, stdout
=subprocess
.PIPE
).communicate()[0].decode().split()
13 file_out
= open(workPath
+ "myDictionary", "w")
15 for file_name
in file_names
:
16 file = open(dictPath
+ file_name
, "r")
18 for word
in file.readlines():
19 word
= word
.strip().lower()
23 file_out
.write('\n'.join(m_dict
))