title: Python multiple file input
body: <p>I'm working on a python program that prints the words that are in the last file entered from the command line. The words can't be in any of the preceding files. So for example if I input 2 files from the command line and</p>
  
  <p>File 1 contains: "We are awesome" and File 2(the last file entered) contains: "We are really awesome"</p>
  
  <p>My final list should only contain: "really"</p>
  
  <p>Right now my code is set up to only look at the last file entered, how can I look at all of the preceding files and compare them in the context of what I am trying to do? Here is my code:</p>
  
  <p>UPDATE</p>
  
  <pre><code>import re
  import sys
  def get_words(filename):
          test_file = open(filename).read()
          lower_split = test_file.lower()
          new_split = re.split("[^a-z']+", lower_split)
          really_new_split = sorted(set(new_split))
          return really_new_split
  if __name__ == '__main__':
  
          bag = []
          for filename in sys.argv[1:]:
                  bag.append(get_words(filename))
  
                  unique_words = bag[-1].copy()
                  for other in bag[:-1]:
                          unique_words -= other
  
                          for word in unique_words:
                                  print(word)
  </code></pre>
  
  <p>Also:</p>
  
  <pre><code>&gt;&gt;&gt; set([1,2,3])
  {1, 2, 3}
  </code></pre>