title: Comparing two directories with subdirectories to find any changes?
body: <p>For starters I've only been playing with python for about a 2 weeks now and im relatively new to its proccessess, I'm trying to create a script that compares two directories with subdirectories and prints out ANY changes. I've read articles on hear about using os.walk to walk the directories and I've managed to write the script that prints all the files in a directory and its subdirectories in a understandable manner. I've also read on here and learned how to compare two directories but it only compares 1 file deep.</p>
  
  <pre><code>import os
  x = 'D:\\xfiles'
  y = 'D:\\yfiles'
  q= [ filename for filename in x if filename not in y ]
  print q 
  </code></pre>
  
  <p>Obviously that does not do what I want it to. This however is listing all files and all directories.</p>
  
  <pre><code>import os
  x = 'D:\\xfiles'
  x1 = os.walk(x)
  for dirName, subdirList, fileList in x1:
       print ('Directory: %s' % dirName)
       for fname in fileList:
       print ('\%s' % fname)
  </code></pre>
  
  <p>How do I combine them and get it to work?</p>