How to delete the same words in .txt file. Useful for preparing of emails

In terminal input:

python restrict.py file.txt