title: Filter out Bad Words From a Text File In Python
body: <p>I am wanting to read the contents of a text file and filter out the bad word from it.
  {UPDATED} So I updated my python file after what you told me but right now I am getting a no module error. When I run pip3 install profanity_filter it gives me a big error.<a href="https://i.stack.imgur.com/ANA81.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ANA81.png" alt="enter image description here" /></a></p>
  <p>I researched and found Profanity but it is not working</p>
  <pre class="lang-py prettyprint-override"><code>from profanity_filter import ProfanityFilter
  pf = ProfanityFilter()
  
  with open(input(&quot;Enter the name Of Your File&quot;), &quot;r&quot;) as myFile:
             j = myFile.read()
  filtered = pf.censor(j)
  print(filtered)
  </code></pre>
  <p>Here is the error I get when I try to run my file
  <a href="https://i.stack.imgur.com/m0EM1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0EM1.png" alt="enter image description here" /></a></p>