I would like to read each word from a given text file and then want to compare these word with an existing English dictionary which may be a system dictionary or any other way. Here is the code I have tried, but in the following code, there is a problem. The following codes reading brackets or any other unnecessary characters.
f=open('words.txt')
M=[word for line in f for word in line.split()]
S=list(set(M))
for i in S:
print i
How can I do the job?