title: Counting unique words in python
body: <p>In direct, my code so far is this : </p>
  
  <pre><code>from glob import glob
  pattern = "D:\\report\\shakeall\\*.txt"
  filelist = glob(pattern)
  def countwords(fp):
      with open(fp) as fh:
          return len(fh.read().split())
  print "There are" ,sum(map(countwords, filelist)), "words in the files. " "From directory",pattern
  </code></pre>
  
  <p>I want to add a code that counts unique words from pattern(42 txt files in this path) but I don't know how. Can anybody help me?</p>